public IActionResult OnGet(int resturantId) { Resturant = resturantData.GetById(resturantId); if (Resturant == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult Details(int id) { var model = _resturnatData.GetById(id); if (model == null) { return(RedirectToAction(nameof(Index))); } return(View(model)); }
public IActionResult OnGet(int id) { Resturant = _resturantData.GetById(id); if (Resturant == null) { return(RedirectToAction("Index", "Home")); } return(Page()); }
public IActionResult OnGet(int?resturantId) { Cuisines = htmlHelper.GetEnumSelectList <CuisineType>(); if (resturantId.HasValue) { Resturant = resturantData.GetById(resturantId.Value); } else { Resturant = new Resturant(); } if (Resturant == null) { return(RedirectToPage("./NotFound")); } return(Page()); }