public IHttpActionResult PutSCCMWindowsWorkstation(int id, SCCMWindowsWorkstation sCCMWindowsWorkstation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != sCCMWindowsWorkstation.ID) { return(BadRequest()); } db.Entry(sCCMWindowsWorkstation).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!SCCMWindowsWorkstationExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PostSCCMWindowsWorkstation(SCCMWindowsWorkstation sCCMWindowsWorkstation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.SCCMWindowsWorkstations.Add(sCCMWindowsWorkstation); db.SaveChanges(); return(Ok(sCCMWindowsWorkstation)); }
public IHttpActionResult DeleteSCCMWindowsWorkstation(int id) { SCCMWindowsWorkstation sCCMWindowsWorkstation = db.SCCMWindowsWorkstations.Find(id); if (sCCMWindowsWorkstation == null) { return(NotFound()); } db.SCCMWindowsWorkstations.Remove(sCCMWindowsWorkstation); db.SaveChanges(); return(Ok(sCCMWindowsWorkstation)); }