コード例 #1
0
 public IActionResult OnGet(int thingId)
 {
     Thing = thingsRepository.GetById(thingId);
     if (Thing == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
コード例 #2
0
        public IActionResult OnGet(int?thingId)
        {
            Types = htmlHelper.GetEnumSelectList <ThingType>();
            if (thingId.HasValue)
            {
                Thing = thingsRepo.GetById(thingId.Value);
            }
            else
            {
                Thing = new Thing();
            }

            if (Thing == null)
            {
                return(RedirectToPage("./NotFound"));
            }
            return(Page());
        }