public IHttpActionResult PutBodyAnalizeResult(int id, BodyAnalizeResult bodyAnalizeResult) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bodyAnalizeResult.ID) { return(BadRequest()); } db.Entry(bodyAnalizeResult).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!BodyAnalizeResultExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetBodyAnalizeResult(int id) { BodyAnalizeResult bodyAnalizeResult = db.BodyAnalizeResult.Find(id); if (bodyAnalizeResult == null) { return(NotFound()); } return(Ok(bodyAnalizeResult)); }
public IHttpActionResult PostBodyAnalizeResult(BodyAnalizeResult bodyAnalizeResult) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.BodyAnalizeResult.Add(bodyAnalizeResult); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = bodyAnalizeResult.ID }, bodyAnalizeResult)); }
public IHttpActionResult DeleteBodyAnalizeResult(int id) { BodyAnalizeResult bodyAnalizeResult = db.BodyAnalizeResult.Find(id); if (bodyAnalizeResult == null) { return(NotFound()); } db.BodyAnalizeResult.Remove(bodyAnalizeResult); db.SaveChanges(); return(Ok(bodyAnalizeResult)); }