public async Task <long> Max(Expression <Func <T, bool> > @where = null, Expression <Func <T, long> > maxColumn = null, bool isIncludeDeleted = false)
        {
            if (maxColumn == null)
            {
                throw new ArgumentException("the field to get the max is not specified!");
            }

            var maxColumnField = _expressionUtils.GetField(maxColumn.Body);

            var parameters = new List <TParameter>();
            var sb         = GetMaxColumnQuery(where, maxColumnField, parameters);

            var result = await SQLExecutor.ExecuteSqlReturningValue <long>(sb, parameters);

            return(result);
        }
Ejemplo n.º 2
0
 public static EmitSyntax Stfld <T, R>(this EmitSyntax emit, Expression <Func <T, R> > expr)
 {
     emit.Stfld(ExpressionUtils.GetField(expr));
     return(emit);
 }