public static LogicalBinaryExpression Between(SqlExpression left, SqlExpression value1, SqlExpression value2)
 {
     return(LogicalBinaryExpression.Expression(ExpressionType.Between, left, new CollectionExpression()
     {
         value1, value2
     }));
 }
Exemple #2
0
 public Queryable <T> GroupBy(Expression <Func <T, object> > field, LogicalBinaryExpression having)
 {
     Groups.Add(SqlExpression.Field(field));
     if (having != null)
     {
         _having = SqlExpression.AndAlso(_having, having);
     }
     return(this);
 }
        public static LogicalBinaryExpression Like(SqlExpression left, SqlExpression right, bool startWith, bool endWith)
        {
            if (startWith)
            {
                right = SqlExpression.Add(right, WildcardsExpression.Instance);
            }
            if (endWith)
            {
                right = SqlExpression.Add(WildcardsExpression.Instance, right);
            }

            return(LogicalBinaryExpression.Expression(ExpressionType.Like, left, right));
        }
Exemple #4
0
        public Queryable <T> GroupBy(SqlExpression field, LogicalBinaryExpression having)
        {
            if (field == null)
            {
                throw new ArgumentNullException("field");
            }

            Groups.Add(field);
            if (having != null)
            {
                _having = SqlExpression.AndAlso(_having, having);
            }
            return(this);
        }
        public static LogicalBinaryExpression NotIn(SqlExpression left, SqlExpression right)
        {
            if (left is DbNullExpression)
            {
                return(IsNotNull(right));
            }

            if (right is DbNullExpression)
            {
                return(IsNotNull(left));
            }

            return(LogicalBinaryExpression.Expression(ExpressionType.NotIn, left, right));
        }
Exemple #6
0
        public Queryable <T> Where(LogicalBinaryExpression logical)
        {
            if (logical == null)
            {
                throw new ArgumentNullException("condition");
            }

            if (_where == null)
            {
                _where = logical;
            }
            else
            {
                _where = SqlExpression.AndAlso(_where, logical);
            }
            return(this);
        }
Exemple #7
0
 public Queryable <T> Where(Expression <Func <T, bool> > logical)
 {
     return(Where(LogicalBinaryExpression.Expression(logical)));
 }
 public static LogicalBinaryExpression In(SqlExpression left, CollectionExpression right)
 {
     return(LogicalBinaryExpression.Expression(ExpressionType.In, left, right));
 }
 public static LogicalBinaryExpression LessThanOrEqual(SqlExpression left, SqlExpression right)
 {
     return(LogicalBinaryExpression.Expression(ExpressionType.LessThanOrEqual, left, right));
 }
 public static LogicalBinaryExpression GreaterThan(SqlExpression left, SqlExpression right)
 {
     return(LogicalBinaryExpression.Expression(ExpressionType.GreaterThan, left, right));
 }
 public static LogicalBinaryExpression IsNotNull(SqlExpression left)
 {
     return(LogicalBinaryExpression.Expression(ExpressionType.IsNot, left, DbNullExpression.Instance));
 }
 public static LogicalBinaryExpression OrElse(SqlExpression left, SqlExpression right)
 {
     return(LogicalBinaryExpression.Expression(ExpressionType.OrElse, left, right));
 }
 public static LogicalBinaryExpression AndAlso(SqlExpression left, SqlExpression right)
 {
     return(LogicalBinaryExpression.Expression(ExpressionType.AndAlso, left, right));
 }