public async Task <IHttpActionResult> PutDeviceSpecificConstants(int id, DeviceSpecificConstants deviceSpecificConstants) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Entry(deviceSpecificConstants).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DeviceSpecificConstantsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetDeviceSpecificConstants(int id) { DeviceSpecificConstants deviceSpecificConstants = await db.DeviceSpecificConstants.FindAsync(id); if (deviceSpecificConstants == null) { return(NotFound()); } return(Ok(deviceSpecificConstants)); }
public async Task <IHttpActionResult> PostDeviceSpecificConstants(DeviceSpecificConstants deviceSpecificConstants) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.DeviceSpecificConstants.Add(deviceSpecificConstants); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = deviceSpecificConstants.Id }, deviceSpecificConstants)); }
public async Task <IHttpActionResult> DeleteDeviceSpecificConstants(int id) { DeviceSpecificConstants deviceSpecificConstants = await db.DeviceSpecificConstants.FindAsync(id); if (deviceSpecificConstants == null) { return(NotFound()); } db.DeviceSpecificConstants.Remove(deviceSpecificConstants); await db.SaveChangesAsync(); return(Ok(deviceSpecificConstants)); }