Ejemplo n.º 1
0
 public IActionResult EditCuisine(Cuisine cuisine)
 {
     if (ModelState.IsValid)
     {
         cRepository.SaveCuisine(cuisine);
         return(RedirectToAction(nameof(Index)));
     }
     else
     {
         return(View(cuisine));
     }
 }
Ejemplo n.º 2
0
 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));
     }
 }