Esempio n. 1
0
 public IActionResult OnGet(int cityId)
 {
     City = cityData.GetById(cityId);
     if (City == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
Esempio n. 2
0
        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());
        }