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()); } }
public ResturantController(ResturantService _resturantService) { resturantService = _resturantService; }