public async Task <IHttpActionResult> PutPropertyInterestedUser(int id, PropertyInterestedUser propertyInterestedUser) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != propertyInterestedUser.ID) { return(BadRequest()); } db.Entry(propertyInterestedUser).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PropertyInterestedUserExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> PutCodePrefix(int id, CodePrefix codePrefix) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != codePrefix.ID) { return(BadRequest()); } db.Entry(codePrefix).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CodePrefixExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> PutSystemSetting(int id, SystemSetting systemSetting) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != systemSetting.ID) { return(BadRequest()); } db.Entry(systemSetting).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SystemSettingExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }