public IActionResult OnPost() { if (ModelState.IsValid) { _customerData.CreateCustomer(Customer); _customerData.CommitChanges(); return(RedirectToPage("/Customers/Index")); } else { return(RedirectToPage(Customer)); } }
public IActionResult OnPost() { Titles = _htmlHelper.GetEnumSelectList <TitleType>(); if (ModelState.IsValid) { _customerData.UpdateCustomer(Customer); _customerData.CommitChanges(); return(RedirectToPage("/Customers/Index")); } else { return(Page()); } }