Created
June 22, 2011 12:16
-
-
Save aidanmorgan/1039958 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IList<WhiskeyDTO> FindWhiskeyForRegion(Guid regionId) | |
{ | |
using (IUnitOfWork uow = _factory.Create("WhiskeyService.FindWhiskeyForRegion")) | |
{ | |
Region r = uow.RegionRepository.FindById(regionId); | |
IList<WhiskeyDTO> result = new List<WhiskeyDTO>(); | |
if (r == null) | |
{ | |
throw new ArgumentException(string.Format("Cannot find whiskey for Region {0} as it does not exist.", regionId), "regionId"); | |
} | |
foreach (Distillery d in r.Distilleries) | |
{ | |
foreach (Whiskey w in d.Whiskeys) | |
{ | |
result.Add(WhiskeyDTO.Create(w)); | |
} | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment