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