public IHttpActionResult Putprograminterventiontype(int id, programinterventiontype programinterventiontype) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != programinterventiontype.ID) { return(BadRequest()); } db.Entry(programinterventiontype).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!programinterventiontypeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Getprograminterventiontype(int id) { programinterventiontype programinterventiontype = db.programinterventiontypes.Find(id); if (programinterventiontype == null) { return(NotFound()); } return(Ok(programinterventiontype)); }
public IHttpActionResult Postprograminterventiontype(programinterventiontype programinterventiontype) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.programinterventiontypes.Add(programinterventiontype); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = programinterventiontype.ID }, programinterventiontype)); }
public IHttpActionResult Deleteprograminterventiontype(int id) { programinterventiontype programinterventiontype = db.programinterventiontypes.Find(id); if (programinterventiontype == null) { return(NotFound()); } db.programinterventiontypes.Remove(programinterventiontype); db.SaveChanges(); return(Ok(programinterventiontype)); }