public async Task <IHttpActionResult> PutCM_Machine(int id, CM_Machine cM_Machine) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cM_Machine.id) { return(BadRequest()); } db.Entry(cM_Machine).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CM_MachineExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }