Class PredicateBuilder
See http://www.albahari.com/expressions for information and examples.
public static class PredicateBuilder
- Inheritance
-
PredicateBuilder
- Inherited Members
Methods
And<T>(Expression<Func<T, bool>>, Expression<Func<T, bool>>)
AND
public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2)
Parameters
expr1
Expression<Func<T, bool>>expr2
Expression<Func<T, bool>>
Returns
- Expression<Func<T, bool>>
Type Parameters
T
Extend<T>(ExpressionStarter<T>, Expression<Func<T, bool>>, PredicateOperator)
Extends the specified source Predicate with another Predicate and the specified PredicateOperator.
public static Expression<Func<T, bool>> Extend<T>(this ExpressionStarter<T> first, Expression<Func<T, bool>> second, PredicateOperator @operator = PredicateOperator.Or)
Parameters
first
ExpressionStarter<T>The source Predicate.
second
Expression<Func<T, bool>>The second Predicate.
operator
PredicateOperatorThe Operator (can be "And" or "Or").
Returns
- Expression<Func<T, bool>>
Expression{Func{T, bool}}
Type Parameters
T
The type
Extend<T>(Expression<Func<T, bool>>, Expression<Func<T, bool>>, PredicateOperator)
Extends the specified source Predicate with another Predicate and the specified PredicateOperator.
public static Expression<Func<T, bool>> Extend<T>(this Expression<Func<T, bool>> first, Expression<Func<T, bool>> second, PredicateOperator @operator = PredicateOperator.Or)
Parameters
first
Expression<Func<T, bool>>The source Predicate.
second
Expression<Func<T, bool>>The second Predicate.
operator
PredicateOperatorThe Operator (can be "And" or "Or").
Returns
- Expression<Func<T, bool>>
Expression{Func{T, bool}}
Type Parameters
T
The type
New<T>(bool)
Create an expression with a stub expression true or false to use when the expression is not yet started.
public static ExpressionStarter<T> New<T>(bool defaultExpression)
Parameters
defaultExpression
bool
Returns
Type Parameters
T
New<T>(Expression<Func<T, bool>>?)
Start an expression
public static ExpressionStarter<T> New<T>(Expression<Func<T, bool>>? expr = null)
Parameters
expr
Expression<Func<T, bool>>
Returns
Type Parameters
T
Or<T>(Expression<Func<T, bool>>, Expression<Func<T, bool>>)
OR
public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2)
Parameters
expr1
Expression<Func<T, bool>>expr2
Expression<Func<T, bool>>
Returns
- Expression<Func<T, bool>>
Type Parameters
T