public IActionResult Create(DishCreateViewModel vmModel, int id) { if (ModelState.IsValid) { try { vmModel.MealId = id; vmModel.CreateDish(); return(RedirectToAction("Index", "Planning")); } catch { throw; } } return(View(vmModel)); }
public IActionResult Create() { var model = new DishCreateViewModel(); return(View(model)); }