コード例 #1
0
 public static IEnumerable <Ingredient> Ingredients(this FoodOrder foodOrder) =>
 foodOrder.FoodNavigation.FoodIngredient
 .Select(fi => fi.IngredientNavigation)
 .Except(foodOrder.FoodOrderIngredient.Where(foi => foi.Isremoval).Select(foi => foi.IngredientNavigation))
 .Concat(foodOrder.FoodOrderIngredient.Where(foi => !foi.Isremoval).Select(foi => foi.IngredientNavigation));
コード例 #2
0
 public static string Key(this FoodOrder foodOrder) =>
 $"{foodOrder.FoodNavigation.Name};{string.Join(";", foodOrder.FoodOrderIngredient.Select(foi => foi.IngredientNavigation.Name))}";
コード例 #3
0
 public static decimal Price(this FoodOrder foodOrder) =>
 foodOrder.FoodOrderIngredient
 .Where(i => !i.Isremoval)
 .Sum(i => i.IngredientNavigation.Price ?? 0) + foodOrder.FoodNavigation.Price;