Skip to main content

PredicateBuilder

Enables the efficient, dynamic composition of query predicates.

Assembly: ServiceStack.OrmLite.dll​
View Source​
Declaration
public static class PredicateBuilder : object

Methods​

True<T>()​

Creates a predicate that evaluates to true.

View Source​
Declaration
public static Expression<Func<T, bool>> True<T>()
Returns​

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

Type Parameters​
  • T

False<T>()​

Creates a predicate that evaluates to false.

View Source​
Declaration
public static Expression<Func<T, bool>> False<T>()
Returns​

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

Type Parameters​
  • T

Create<T>(Expression<Func<T, Boolean>>)​

Creates a predicate expression from the specified lambda expression.

View Source​
Declaration
public static Expression<Func<T, bool>> Create<T>(Expression<Func<T, bool>> predicate)
Returns​

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

Parameters​
TypeName
Expression<Func<<T>,System.Boolean>>predicate
Type Parameters​
  • T

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

Combines the first predicate with the second using the logical "and".

View Source​
Declaration
public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> first, Expression<Func<T, bool>> second)
Returns​

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

Parameters​
TypeName
Expression<Func<<T>,System.Boolean>>first
Expression<Func<<T>,System.Boolean>>second
Type Parameters​
  • T

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

Combines the first predicate with the second using the logical "or".

View Source​
Declaration
public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> first, Expression<Func<T, bool>> second)
Returns​

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

Parameters​
TypeName
Expression<Func<<T>,System.Boolean>>first
Expression<Func<<T>,System.Boolean>>second
Type Parameters​
  • T

Not<T>(Expression<Func<T, Boolean>>)​

Negates the predicate.

View Source​
Declaration
public static Expression<Func<T, bool>> Not<T>(this Expression<Func<T, bool>> expression)
Returns​

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

Parameters​
TypeName
Expression<Func<<T>,System.Boolean>>expression
Type Parameters​
  • T