public IHttpActionResult PutConsultaEstudioLaboratorio(int id, ConsultaEstudioLaboratorio consultaEstudioLaboratorio) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != consultaEstudioLaboratorio.idConsultaEstudioLaboratorio) { return(BadRequest()); } db.Entry(consultaEstudioLaboratorio).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ConsultaEstudioLaboratorioExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetConsultaEstudioLaboratorio(int id) { ConsultaEstudioLaboratorio consultaEstudioLaboratorio = db.ConsultaEstudioLaboratorio.Find(id); if (consultaEstudioLaboratorio == null) { return(NotFound()); } return(Ok(consultaEstudioLaboratorio)); }
public IHttpActionResult PostConsultaEstudioLaboratorio(ConsultaEstudioLaboratorio consultaEstudioLaboratorio) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ConsultaEstudioLaboratorio.Add(consultaEstudioLaboratorio); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = consultaEstudioLaboratorio.idConsultaEstudioLaboratorio }, consultaEstudioLaboratorio)); }
public IHttpActionResult DeleteConsultaEstudioLaboratorio(int id) { ConsultaEstudioLaboratorio consultaEstudioLaboratorio = db.ConsultaEstudioLaboratorio.Find(id); if (consultaEstudioLaboratorio == null) { return(NotFound()); } db.ConsultaEstudioLaboratorio.Remove(consultaEstudioLaboratorio); db.SaveChanges(); return(Ok(consultaEstudioLaboratorio)); }