示例#1
0
        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);
        }
示例#2
0
 public PortionFoodService(ApplicationDbContext context)
 {
     FoodService  = new FoodService(context);
     DishService  = new DishService(context);
     this.context = context;
 }
示例#3
0
 public DishEatingService(ApplicationDbContext context) : base(context)
 {
     DishService   = new DishService(context);
     EatingService = new EatingService(context);
 }