/// <summary> /// AddPredicate /// </summary> /// <param name="condition"></param> /// <param name="expression"></param> public void AddPredicate(bool condition, Expression <Func <T, bool> > expression) { var predicate = new WorkDataPredicate <T> { Condition = condition, Expression = expression }; Predicates.Add(predicate); }
public PredicateGroup(bool isInterceptor) { Predicates = new List <WorkDataPredicate <T> >(); if (!isInterceptor) { return; } //TODO 需重构 var where = ExpressionHelper .GenerateCondition <T, long?>("BelongUserId", 1); var predicate = new WorkDataPredicate <T> { Condition = true, Expression = where }; Predicates.Add(predicate); }