Show / Hide Table of Contents

Class PredicateBuilder

See http://www.albahari.com/expressions for information and examples.

Inheritance
System.Object
PredicateBuilder
Namespace: System.Linq
Assembly: Volo.Abp.Core.dll
Syntax
public static class PredicateBuilder : object

Methods

And<T>(Expression<Func<T, Boolean>>, Expression<Func<T, Boolean>>)

AND

Declaration
public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2)
Parameters
Type Name Description
Expression<Func<T, System.Boolean>> expr1
Expression<Func<T, System.Boolean>> expr2
Returns
Type Description
Expression<Func<T, System.Boolean>>
Type Parameters
Name Description
T

Extend<T>(Expression<Func<T, Boolean>>, Expression<Func<T, Boolean>>, PredicateOperator)

Extends the specified source Predicate with another Predicate and the specified PredicateOperator.

Declaration
public static Expression<Func<T, bool>> Extend<T>(this Expression<Func<T, bool>> first, Expression<Func<T, bool>> second, PredicateOperator operator = PredicateOperator.Or)
Parameters
Type Name Description
Expression<Func<T, System.Boolean>> first

The source Predicate.

Expression<Func<T, System.Boolean>> second

The second Predicate.

PredicateOperator operator

The Operator (can be "And" or "Or").

Returns
Type Description
Expression<Func<T, System.Boolean>>

Expression{Func{T, bool}}

Type Parameters
Name Description
T

The type

Extend<T>(ExpressionStarter<T>, Expression<Func<T, Boolean>>, PredicateOperator)

Extends the specified source Predicate with another Predicate and the specified PredicateOperator.

Declaration
public static Expression<Func<T, bool>> Extend<T>(this ExpressionStarter<T> first, Expression<Func<T, bool>> second, PredicateOperator operator = PredicateOperator.Or)
Parameters
Type Name Description
ExpressionStarter<T> first

The source Predicate.

Expression<Func<T, System.Boolean>> second

The second Predicate.

PredicateOperator operator

The Operator (can be "And" or "Or").

Returns
Type Description
Expression<Func<T, System.Boolean>>

Expression{Func{T, bool}}

Type Parameters
Name Description
T

The type

New<T>(Expression<Func<T, Boolean>>)

Start an expression

Declaration
public static ExpressionStarter<T> New<T>(Expression<Func<T, bool>> expr = null)
Parameters
Type Name Description
Expression<Func<T, System.Boolean>> expr
Returns
Type Description
ExpressionStarter<T>
Type Parameters
Name Description
T

New<T>(Boolean)

Create an expression with a stub expression true or false to use when the expression is not yet started.

Declaration
public static ExpressionStarter<T> New<T>(bool defaultExpression)
Parameters
Type Name Description
System.Boolean defaultExpression
Returns
Type Description
ExpressionStarter<T>
Type Parameters
Name Description
T

Or<T>(Expression<Func<T, Boolean>>, Expression<Func<T, Boolean>>)

OR

Declaration
public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2)
Parameters
Type Name Description
Expression<Func<T, System.Boolean>> expr1
Expression<Func<T, System.Boolean>> expr2
Returns
Type Description
Expression<Func<T, System.Boolean>>
Type Parameters
Name Description
T
Back to top Powered by Volosoft