Пример #1
0
        public async override Task <int> UpdateAsync(Expression <Func <T, T> > expression, CancellationToken cancellationToken = default(CancellationToken))
        {
            DataTableEntityMapping mapping      = DataEntityMapping.GetTableMapping(typeof(T));
            MassUpdator            updator      = LambdaExpressionExtend.CreateMassUpdator(expression);
            QueryCommand           queryCommand = _context.Database.QueryUpdate(_context, mapping, updator, _query);

            return(await _context.ExecuteNonQueryAsync(queryCommand.Command, _level, cancellationToken));
        }
Пример #2
0
        public override int Update(Expression <Func <T, T> > expression)
        {
            DataTableEntityMapping mapping      = DataEntityMapping.GetTableMapping(typeof(T));
            MassUpdator            updator      = LambdaExpressionExtend.CreateMassUpdator(expression);
            QueryCommand           queryCommand = _context.Database.QueryUpdate(_context, mapping, updator, _query);

            return(_context.ExecuteNonQuery(queryCommand.Command, _level));
        }