public IActionResult EditCuisine(Cuisine cuisine) { if (ModelState.IsValid) { cRepository.SaveCuisine(cuisine); return(RedirectToAction(nameof(Index))); } else { return(View(cuisine)); } }
public IActionResult EditCuisine(Cuisine cuisine) { if (ModelState.IsValid) { cRepository.SaveCuisine(cuisine); TempData["message"] = $"{cuisine.CuisineType} Cuisine has been saved!"; return(RedirectToAction(nameof(CuisineIndex))); } else { return(View(cuisine)); } }