Пример #1
0
 public IActionResult OnGet(int planetId)
 {
     Planet = _planetData.GetPlanetById(planetId);
     if (Planet == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
Пример #2
0
 public IActionResult OnGet(int?planetId)
 {
     PlanetTypes = _htmlHelper.GetEnumSelectList <PlanetType>();
     if (planetId.HasValue)
     {
         Planet = _planetData.GetPlanetById(planetId.Value);
     }
     else
     {
         Planet = new Planet();
     }
     if (Planet == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }