Пример #1
0
 public IActionResult OnGet(int contactId)
 {
     Contact = contactData.GetById(contactId);
     if (Contact == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
Пример #2
0
 public IActionResult OnGet(int?contactId)
 {
     ContactTypes = htmlHelper.GetEnumSelectList <ContactType>();
     if (contactId.HasValue)
     {
         Contact = contactData.GetById(contactId.Value);
     }
     else
     {
         Contact = new Contact();
     }
     if (Contact == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }