DevForce Help Reference
False<T> Method
Example 


Returns an expression evaluating to false.
Syntax
'Declaration
 
Public Shared Function False(Of T)() As Expression(Of Func(Of T,Boolean))
'Usage
 
Dim value As Expression(Of Func(Of T,Boolean))
 
value = PredicateBuilder.False(Of T)()
public static Expression<Func<T,bool>> False<T>()

Type Parameters

T
Remarks
Can be used as the base expression when building a dynamic predicate containing an unknown number of expressions.
Example
var mgr = new DomainModelEntityManager();          
var predicate = PredicateBuilder.False<Product>();

foreach (string category in new string[] { "Meat", "Dairy", "Grains" }) {
  string temp = category;
  predicate = predicate.Or(p => p.Category.Name.StartsWith(temp));
}

var query = mgr.Products.Where(predicate);
var list = query.ToList();
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

PredicateBuilder Class
PredicateBuilder Members

Send Feedback