public ActionResult Edit(int id) { Meal meal = _mealServices.GetMeal(UserId, id); MealViewModel mealViewModel = Mapper.Map <Meal, MealViewModel>(meal); return(View(mealViewModel)); }
public ActionResult UseMeal(int id, DateTime date) { Meal meal = _mealServices.GetMeal(UserId, id); foreach (Ingredient ingredient in meal.Ingredients) { _foodItemServices.InsertFoodItem(ingredient.Code, ingredient.Quantity, date, UserId); } var viewModel = GetFoodItemTableViewModel(date); return(PartialView("FoodItemTable", viewModel)); }