Example #1
0
 public IEnumerable<BagelChoice> GetSelection(BagelShopType bagelShopType)
 {
     var orderedChoices = Choices.OrderBy(x => x.Ordering);
     return orderedChoices.Where(x => x.Location.LocationId == (int) bagelShopType)
         .Concat(
             orderedChoices.Where(x => x.Location.LocationId != (int) bagelShopType));
 }
Example #2
0
 public static BagelShop BuildIndividualShoppingList(BagelShopType bagelShopType, IEnumerable<Bageller> bagellers)
 {
     var shop = new BagelShop(bagelShopType);
     foreach (var bageller in bagellers)
     {
         shop.AddBagel(string.Join(",", bageller.GetSelection(bagelShopType).Select(x => x.Bagel)));
     }
     return shop;
 }
Example #3
0
 public BagelShop(BagelShopType type)
 {
     Type = type;
     Bagels = new List<Bagel>();
 }