public IActionResult OnPost()
 {
     if (ModelState.IsValid)
     {
         ResturantService.AddResturant(ResturantToAdd);
         TempData["Message"] = "Added successfully!";
         ResturantService.commit();
         return(RedirectToPage("List"));
     }
     else
     {
         TempData["Message"] = "some thing went wrong!";
         Cusines             = Helper.GetEnumSelectList <CusineType>();
         return(Page());
     }
 }
示例#2
0
 public ResturantController(ResturantService _resturantService)
 {
     resturantService = _resturantService;
 }