//public void OnGet(int resturantID) //{ // //Resturant = new Resturant(); // //Resturant.ID = resturantID; // Resturant = resturantData.GetByID(resturantID); //} public IActionResult OnGet(int resturantID) { Resturant = resturantData.GetByID(resturantID); if (Resturant == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult OnGet(int?resturantID) { Cuisines = htmlHelper.GetEnumSelectList <CuisineType>(); if (resturantID.HasValue) { Resturant = resturantData.GetByID(resturantID); } else { Resturant = new Resturant(); } if (Resturant == null) { return(RedirectToPage("./NotFound")); } return(Page()); }