public ActionResult Edit(Recipe recipe) { if (ModelState.IsValid) { RecipeRepository.Edit(recipe); return(RedirectToAction("Index")); } return(View(recipe)); }
public IActionResult ModifyConfirmation(IFormCollection formCollection) { if (String.IsNullOrEmpty(formCollection["recipename"])) { return(View("Error")); } var recipe = new Recipe() { Name = formCollection["recipename"], Id = Convert.ToInt32(formCollection["id"]) }; recipeRepository.Edit(recipe); return(View(recipe)); }