public IHttpActionResult Putprogramdevicetype(int id, programdevicetype programdevicetype) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != programdevicetype.ID) { return(BadRequest()); } db.Entry(programdevicetype).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!programdevicetypeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Getprogramdevicetype(int id) { programdevicetype programdevicetype = db.programdevicetypes.Find(id); if (programdevicetype == null) { return(NotFound()); } return(Ok(programdevicetype)); }
public IHttpActionResult Postprogramdevicetype(programdevicetype programdevicetype) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.programdevicetypes.Add(programdevicetype); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = programdevicetype.ID }, programdevicetype)); }
public IHttpActionResult Deleteprogramdevicetype(int id) { programdevicetype programdevicetype = db.programdevicetypes.Find(id); if (programdevicetype == null) { return(NotFound()); } db.programdevicetypes.Remove(programdevicetype); db.SaveChanges(); return(Ok(programdevicetype)); }