public override ValidationResult IsCorrectItem(DishEating item) { ValidationResult valResult = new ValidationResult(true); if (item.Dish == null && DishService.Get(item.IdDish) == null) { valResult.AddErrorMessage("IdDish is incorrect"); } if (item.Eating == null && DishService.Get(item.IdEatinng) == null) { valResult.AddErrorMessage("IdEatinng is incorrect"); } return(valResult); }
public PortionFoodService(ApplicationDbContext context) { FoodService = new FoodService(context); DishService = new DishService(context); this.context = context; }
public DishEatingService(ApplicationDbContext context) : base(context) { DishService = new DishService(context); EatingService = new EatingService(context); }