public IActionResult OnGet(int thingId) { Thing = thingsRepository.GetById(thingId); if (Thing == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
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()); }