示例#1
0
        public int AddMeal(NewMealVm mealVm)
        {
            var meal = _mapper.Map <Meal>(mealVm);
            var id   = _mealRepo.AddMeal(meal);

            return(id);
        }
示例#2
0
 public IActionResult EditMeal(NewMealVm model)
 {
     _mealService.UpdateMeal(model);
     return(RedirectToAction("Index"));
 }
示例#3
0
 public IActionResult AddMeal(NewMealVm model)
 {
     _mealService.AddMeal(model);
     return(View(model));
 }
示例#4
0
        public void UpdateMeal(NewMealVm model)
        {
            var meal = _mapper.Map <Meal>(model);

            _mealRepo.UpdateMeal(meal);
        }