public IActionResult OnGet(int cityId) { City = cityData.GetById(cityId); if (City == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult OnGet(int?cityId) { CityType = htmlHelper.GetEnumSelectList <CityType>(); if (cityId.HasValue) { City = cityData.GetById(cityId.Value); } else { City = new City(); } if (City == null) { return(RedirectToPage("./NotFound")); } return(Page()); }