public IHttpActionResult PostLOTE_FINAL(LOTE_FINAL lOTE_FINAL) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.LOTE_FINAL.Add(lOTE_FINAL); try { db.SaveChanges(); } catch (DbUpdateException) { if (LOTE_FINALExists(lOTE_FINAL.CPF)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = lOTE_FINAL.CPF }, lOTE_FINAL)); }
public IHttpActionResult PutLOTE_FINAL(string id, LOTE_FINAL lOTE_FINAL) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != lOTE_FINAL.CPF) { return(BadRequest()); } db.Entry(lOTE_FINAL).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!LOTE_FINALExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetLOTE_FINAL(string id) { LOTE_FINAL lOTE_FINAL = db.LOTE_FINAL.Find(id); if (lOTE_FINAL == null) { return(NotFound()); } return(Ok(lOTE_FINAL)); }
public IHttpActionResult DeleteLOTE_FINAL(string id) { LOTE_FINAL lOTE_FINAL = db.LOTE_FINAL.Find(id); if (lOTE_FINAL == null) { return(NotFound()); } db.LOTE_FINAL.Remove(lOTE_FINAL); db.SaveChanges(); return(Ok(lOTE_FINAL)); }