public override async Task <int> UpdateAsync(Expression <Func <T, T> > expression, CancellationToken cancellationToken = default) { var mapping = DataEntityMapping.GetTableMapping(typeof(T)); var updator = LambdaExpressionExtend.CreateMassUpdateExpression(expression); var queryCommand = _context.Database.QueryUpdate(_context, mapping, updator, _query); return(await _context.ExecuteNonQueryAsync(queryCommand.Command, _level, cancellationToken)); }
public override int Update(Expression <Func <T, T> > expression) { var mapping = DataEntityMapping.GetTableMapping(typeof(T)); var updator = LambdaExpressionExtend.CreateMassUpdateExpression(expression); var queryCommand = _context.Database.QueryUpdate(_context, mapping, updator, _query); return(_context.ExecuteNonQuery(queryCommand.Command, _level)); }