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)); }
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)); }