Esempio n. 1
0
 /// <summary>
 /// Combines the first predicate with the second using the logical "or".
 /// </summary>
 public static Expression <Func <T, bool> > Or <T>(this Expression <Func <T, bool> > first, Expression <Func <T, bool> > second)
 {
     return(first.Compose(second, Expression.OrElse));
 }
Esempio n. 2
0
 public static Expression <Func <T, bool> > And <T> (this Expression <Func <T, bool> > first, Expression <Func <T, bool> > second)
 {
     return(first.Compose <Func <T, bool> > (second, new Func <Expression, Expression, Expression> (Expression.And)));
 }
Esempio n. 3
0
 /// <summary>
 /// Combines the first predicate with the second using the logical "and".
 /// </summary>
 public static Expression <Func <T, bool> > And <T>(this Expression <Func <T, bool> > first, Expression <Func <T, bool> > second)
 {
     return(first.Compose(second, Expression.AndAlso));
 }
Esempio n. 4
0
 /// <summary>
 /// 以 Expression.OrElse 组合两个Expression表达式
 /// </summary>
 /// <typeparam name="T">表达式的主实体类型</typeparam>
 /// <param name="first">第一个Expression表达式</param>
 /// <param name="second">要组合的Expression表达式</param>
 /// <returns>组合后的表达式</returns>
 public static Expression <Func <T, bool> > Or <T>(this Expression <Func <T, bool> > first, Expression <Func <T, bool> > second)
 {
     first.CheckNotNull("first");
     second.CheckNotNull("second");
     return(first.Compose(second, Expression.OrElse));
 }