public IHttpActionResult PutDetallesComision(int id, DetallesComision detallesComision) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != detallesComision.Id) { return(BadRequest()); } db.Entry(detallesComision).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!DetallesComisionExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetDetallesComision(int id) { DetallesComision detallesComision = db.DetallesComision.Find(id); if (detallesComision == null) { return(NotFound()); } return(Ok(detallesComision)); }
public IHttpActionResult PostDetallesComision(DetallesComision detallesComision) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.DetallesComision.Add(detallesComision); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = detallesComision.Id }, detallesComision)); }
public IHttpActionResult DeleteDetallesComision(int id) { DetallesComision detallesComision = db.DetallesComision.Find(id); if (detallesComision == null) { return(NotFound()); } db.DetallesComision.Remove(detallesComision); db.SaveChanges(); return(Ok(detallesComision)); }