public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(ContactEmail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContactEmailExists(ContactEmail.ID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index", new { id = ContactEmail.ContactID })); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Address).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AddressExists(Address.Id)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }