public IActionResult OnGet(int characterId) { Character = characterData.GetById(characterId); if (Character == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult OnGet(int?characterId) { Races = htmlHelper.GetEnumSelectList <CharacterRace>(); if (characterId.HasValue) { Character = characterData.GetById(characterId.Value); } else { Character = new Character(); } if (Character == null) { return(RedirectToPage("./NotFound")); } else { return(Page()); } }