public async Task <IActionResult> PutPerson(string id, Person person) { if (id != person.FirstName) { return(BadRequest()); } _context.Entry(person).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Update(String id, Person person) { if (id != person.FirstName) { return(BadRequest()); } _context.Entry(person).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }