public IHttpActionResult PutContato(long id, Contato contato) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != contato.ContatoID) { return(BadRequest()); } ContatoDAO contatoDAO = new ContatoDAO(); contatoDAO.Update(contato); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ContatoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }