public IActionResult OnGet(int restaurantId) { Restaurant = restaurantData.GetRestaurantsById(restaurantId); if (Restaurant != null) { return(Page()); } else { return(RedirectToPage("./notfound")); } }
public IActionResult OnGet(int?restaurantId) { Cuisines = htmlHelper.GetEnumSelectList <CuisineType>(); if (restaurantId.HasValue) { Restaurant = restaurantData.GetRestaurantsById(restaurantId.Value); } else { Restaurant = new Restaurant(); } if (Restaurant == null) { return(RedirectToPage("./notfound")); } else { return(Page()); } }