DevForce Help Reference
Not<T> Method (PredicateBuilder)
Example 


Returns a NOT'd version of the specified expression.
Syntax
'Declaration
 
Public Shared Function Not(Of T)( _
   ByVal expr As Expression(Of Func(Of T,Boolean)) _
) As Expression(Of Func(Of T,Boolean))
'Usage
 
Dim expr As Expression(Of Func(Of T,Boolean))
Dim value As Expression(Of Func(Of T,Boolean))
 
value = PredicateBuilder.Not(Of T)(expr)

Parameters

expr

Type Parameters

T
Example
public void NotQuery() {
  var mgr = new DomainModelEntityManager();
  Expression<Func<Customer, bool>> crit1 = c => c.Country.Equals("Mexico");
  var finalcrit = PredicateBuilder.Not(crit1);
  var results = mgr.Customers.Where(finalcrit).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