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

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

            _mealRepo.UpdateMeal(meal);
        }