// PUT api/UserAppSetting/5 public IHttpActionResult PutUserAppSetting(int id, UserAppSetting userappsetting) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != userappsetting.UserAppSettingId) { return(BadRequest()); } db.Entry(userappsetting).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!UserAppSettingExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetUserAppSetting(int id) { UserAppSetting userappsetting = db.UserAppSettings.Find(id); if (userappsetting == null) { return(NotFound()); } return(Ok(userappsetting)); }
public IHttpActionResult PostUserAppSetting(UserAppSetting userappsetting) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.UserAppSettings.Add(userappsetting); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = userappsetting.UserAppSettingId }, userappsetting)); }
public IHttpActionResult DeleteUserAppSetting(int id) { UserAppSetting userappsetting = db.UserAppSettings.Find(id); if (userappsetting == null) { return(NotFound()); } db.UserAppSettings.Remove(userappsetting); db.SaveChanges(); return(Ok(userappsetting)); }