public async Task <IActionResult> PutContato(int id, Contato contato) { if (id != contato.Id) { return(BadRequest()); } _context.Entry(contato).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContatoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Update(Student t) { conn.Entry(t).State = EntityState.Modified; }