T
IdeaBlade DevForce 2010 Help Reference
False<T> Method
See Also  Example Send Feedback
IdeaBlade.Linq Assembly > IdeaBlade.Linq Namespace > PredicateBuilder Class : False<T> Method



Returns an expression evaluating to false.

Syntax

Visual Basic (Declaration) 
Public Shared Function False(Of T)() As Expression(Of Func(Of T,Boolean))
Visual Basic (Usage)Copy Code
Dim value As Expression(Of Func(Of T,Boolean))
 
value = PredicateBuilder.False(Of T)()
C# 
public static Expression<Func<T,bool>> False<T>()
C++/CLI 
public:
static Expression<Func<T^,bool>^>^ Falsegeneric<typename T>
(); 

Type Parameters

T

Example

C#Copy Code
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();

Remarks

Can be used as the base expression when building a dynamic predicate containing an unknown number of expressions.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.