public async Task <IActionResult> PutContactList([FromRoute] int id, [FromBody] ContactList contactList) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != contactList.ContactId) { return(BadRequest()); } _context.Entry(contactList).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContactListExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPersonDetail([FromRoute] int id, [FromBody] PersonDetail personDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != personDetail.PersonId) { return(BadRequest()); } _context.Entry(personDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }