public async Task <IHttpActionResult> PutInstallZone(int id, InstallZone installZone) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != installZone.InstallZoneId) { return(BadRequest()); } db.Entry(installZone).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InstallZoneExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> PutAppointment(Appointment appointment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Entry(appointment).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppointmentExists(appointment.AppointmentID)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }