public async Task <IHttpActionResult> PutClientes(decimal id, Clientes clientes) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != clientes.IdCliente) { return(BadRequest()); } db.Entry(clientes).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientesExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }