DevForce Help Reference
ToPredicate<T> Method
Example 


Returns an Expression{Func{T}} representing the predicate.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Shared Function ToPredicate(Of T)( _
   ByVal predicate As IPredicateDescription _
) As Expression(Of Func(Of T,Boolean))
'Usage
 
Dim predicate As IPredicateDescription
Dim value As Expression(Of Func(Of T,Boolean))
 
value = DynamicQueryExtensions.ToPredicate(Of T)(predicate)

Parameters

predicate

Type Parameters

T
Example
public void UsingToPredicate() {
  var expr1 = new PredicateDescription(typeof(Product), "UnitPrice", FilterOperator.IsGreaterThanOrEqualTo, 24);
  var exprFunc = expr1.ToPredicate<Product>();
  var results = manager.Products.Where(exprFunc).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

DynamicQueryExtensions Class
DynamicQueryExtensions Members

Send Feedback