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