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



predicate
Returns an Expression{Func{T}} representing the predicate.

Syntax

Visual Basic (Declaration) 
<ExtensionAttribute()>
Public Shared Function ToPredicate(Of T)( _
   ByVal predicate As IPredicateDescription _
) As Expression(Of Func(Of T,Boolean))
Visual Basic (Usage)Copy Code
Dim predicate As IPredicateDescription
Dim value As Expression(Of Func(Of T,Boolean))
 
value = DynamicQueryExtensions.ToPredicate(Of T)(predicate)
C++/CLI 
[ExtensionAttribute()]
public:
static Expression<Func<T^,bool>^>^ ToPredicategeneric<typename T>
( 
   IPredicateDescription^ predicate
) 

Parameters

predicate

Type Parameters

T

Example

C#Copy Code
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 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.