public async Task <IActionResult> OnPostSavePerson() { if (Person == null) { await _context.AddAsync(Person); } else { _context.Update(Person); } await _context.SaveChangesAsync(); return(RedirectToPage("Person")); }
public async Task AddAsync(PhoneNumber phoneNumber) { await _context.AddAsync(phoneNumber); await _context.SaveChangesAsync(); }