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