示例#1
0
 /// <summary>
 ///     设置查询条件
 /// </summary>
 /// <param name="predicate"></param>
 public void Where(Expression conditionExpression)
 {
     if (conditionExpression == null)
     {
         return;
     }
     WhereExpressions.Add(conditionExpression);
 }
示例#2
0
 /// <summary>
 ///     设置查询条件
 /// </summary>
 /// <param name="predicate"></param>
 public void Where(Expression <Func <T, bool> > conditionExpression)
 {
     if (conditionExpression == null || conditionExpression.Body == null)
     {
         return;
     }
     WhereExpressions.Add(conditionExpression.Body);
 }
示例#3
0
            public void AddGroupByExpression(Expression expression)
            {
                if (GroupByExpression != null || WhereExpressions?.Any() == true)
                {
                    throw new NotImplementedException();
                }

                GroupByExpression = expression;
            }
示例#4
0
            public void AddCreateAggregateExpression(Expression expression)
            {
                if (CreateAggregateExpression != null || GroupByExpression != null ||
                    WhereExpressions?.Any() == true)
                {
                    throw new NotImplementedException();
                }

                CreateAggregateExpression = expression;
            }
示例#5
0
        /// <summary>
        ///  增加查询条件
        /// </summary>
        /// <typeparam name="TResult">查询表达式的对象</typeparam>
        /// <param name="alisName">alisName</param>
        /// <param name="predicate">查询表达式</param>
        /// <returns></returns>
        public virtual void Where <TResult>(string alisName, Expression <Func <TResult, bool> > predicate)
        {
            ExpressionInfo em = new ExpressionInfo
            {
                Body          = predicate.Body,
                Model         = typeof(TResult),
                UnionAlisName = alisName
            };

            WhereExpressions.Add(em);
        }
示例#6
0
        public SelectQuery <T> Using(IEnumerable <Expression <Func <T, bool> > > expressions)
        {
            if (expressions.IsEmpty())
            {
                return(this);
            }

            WhereExpressions.AddRange(expressions);

            return(this);
        }
示例#7
0
 public void AddWhereExpression(Expression expression)
 {
     if (WhereExpressions == null)
     {
         WhereExpressions = new List <Expression> {
             expression
         };
     }
     else
     {
         WhereExpressions.Add(expression);
     }
 }
示例#8
0
        public SelectQuery <T> Where(Expression <Func <T, bool> > expression)
        {
            WhereExpressions.Add(expression);

            return(this);
        }
示例#9
0
 protected void AddWhere(Expression <Func <T, bool> > selectExpression)
 {
     WhereExpressions.Add(selectExpression);
 }