public IHttpActionResult PutArea(int id, Area area) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != area.Id) { return(BadRequest()); } db.Entry(area).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!AreaExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public int UpdateWidgetConf(WidgetConfModel target, WidgetConfModel model) { _context.Entry(target).CurrentValues.SetValues(model); return(_context.SaveChanges()); }
public int UpdateUser(UserUpdateModel updatedUser, UserModel target) { _context.Entry(target).CurrentValues.SetValues(updatedUser); return(_context.SaveChanges()); }