public IHttpActionResult PutHistorialSE(int id, HistorialSE historialSE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != historialSE.IDhistorialSe) { return(BadRequest()); } db.Entry(historialSE).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!HistorialSEExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetHistorialSE(int id) { HistorialSE historialSE = db.HistorialSE.Find(id); if (historialSE == null) { return(NotFound()); } return(Ok(historialSE)); }
public IHttpActionResult PostHistorialSE(HistorialSE historialSE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.HistorialSE.Add(historialSE); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = historialSE.IDhistorialSe }, historialSE)); }
public IHttpActionResult DeleteHistorialSE(int id) { HistorialSE historialSE = db.HistorialSE.Find(id); if (historialSE == null) { return(NotFound()); } db.HistorialSE.Remove(historialSE); db.SaveChanges(); return(Ok(historialSE)); }