示例#1
0
        public void UpdateApp(App app, params Expression <Func <App, object> >[] changedProperties)
        {
            _context.Apps.Attach(app);

            foreach (var property in changedProperties)
            {
                _context.Entry(app).Property(property).IsModified = true;
            }
        }
示例#2
0
        public void UpdatePartially(TEntity entity, params Expression <Func <TEntity, object> >[] changedProperties)
        {
            var set = _context.Set <TEntity>();

            set.Attach(entity);

            foreach (var property in changedProperties)
            {
                _context.Entry(entity).Property(property).IsModified = true;
            }
        }