Exemplo n.º 1
0
 public static bool IsMultipleFood(TimeOfDay tod, Dish dish)
 {
     return rest.multipleFoodList.Where(x => x.TimeOfDay == tod && x.FoodIDList.Contains(dish.FoodID)).Count() > 0;
 }
Exemplo n.º 2
0
 public static int GetValidQuantity(List<int> listDishes, Dish dish)
 {
     // Getting the Dish quantity and checking if the inserted Food is multiple for the Time of Day
     int quantity = listDishes.Count(x => x == (int)dish.DishType);
     return quantity == 1 || IsMultipleFood(dish.TimeOfDay, dish) ? quantity : -1;
 }