コード例 #1
0
 public IActionResult OnGet(int characterId)
 {
     Character = characterData.GetById(characterId);
     if (Character == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
コード例 #2
0
        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());
            }
        }