/// <summary> /// 设置查询条件 /// </summary> /// <param name="predicate"></param> public void Where(Expression conditionExpression) { if (conditionExpression == null) { return; } WhereExpressions.Add(conditionExpression); }
/// <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); }
public void AddGroupByExpression(Expression expression) { if (GroupByExpression != null || WhereExpressions?.Any() == true) { throw new NotImplementedException(); } GroupByExpression = expression; }
public void AddCreateAggregateExpression(Expression expression) { if (CreateAggregateExpression != null || GroupByExpression != null || WhereExpressions?.Any() == true) { throw new NotImplementedException(); } CreateAggregateExpression = expression; }
/// <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); }
public SelectQuery <T> Using(IEnumerable <Expression <Func <T, bool> > > expressions) { if (expressions.IsEmpty()) { return(this); } WhereExpressions.AddRange(expressions); return(this); }
public void AddWhereExpression(Expression expression) { if (WhereExpressions == null) { WhereExpressions = new List <Expression> { expression }; } else { WhereExpressions.Add(expression); } }
public SelectQuery <T> Where(Expression <Func <T, bool> > expression) { WhereExpressions.Add(expression); return(this); }
protected void AddWhere(Expression <Func <T, bool> > selectExpression) { WhereExpressions.Add(selectExpression); }