public IActionResult OnGet(int planetId) { Planet = _planetData.GetPlanetById(planetId); if (Planet == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
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()); }