public IActionResult OnGet(int id)
 {
     Character = _characterData.Get(id);
     if(Character == null)
     {
         return RedirectToAction("Index", "Home");
     }
     return Page();
 }
示例#2
0
        public IActionResult Details(int id)
        {
            var model = _characterData.Get(id);

            if (model == null)
            {
                return(RedirectToAction(nameof(Index)));
            }

            return(View(model));
        }