Example #1
0
 public IActionResult AddChef(Chef newChef)
 {
     System.Console.WriteLine("*********** new chef time **************");
     if (ModelState.IsValid)
     {
         DbContext.Add(newChef);
         DbContext.SaveChanges();
         System.Console.WriteLine("*********** adding new chef ***********");
         return(RedirectToAction("Index"));
     }
     return(View("NewChef"));
 }
Example #2
0
 public IActionResult AddChef(Chef newChef)
 {
     if (ModelState.IsValid)
     {
         dbContext.Add(newChef);
         dbContext.SaveChanges();
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View("AddChef"));
     }
 }