IdeaBlade.Linq Assembly > IdeaBlade.Linq Namespace > PredicateDescription Class > PredicateDescription Constructor : PredicateDescription Constructor(Type,String,FilterOperator,Object,Boolean) |
'Declaration
Public Function New( _ ByVal instanceType As Type, _ ByVal propertyPath As String, _ ByVal filterOp As FilterOperator, _ ByVal value As Object, _ Optional ByVal ignoreCase As Boolean _ )
'Usage
Dim instanceType As Type Dim propertyPath As String Dim filterOp As FilterOperator Dim value As Object Dim ignoreCase As Boolean Dim instance As New PredicateDescription(instanceType, propertyPath, filterOp, value, ignoreCase)
public PredicateDescription( Type instanceType, string propertyPath, FilterOperator filterOp, object value, bool ignoreCase )
Exception | Description |
---|---|
System.Exception | Unable to locate property 'x' on type 'y' |
System.InvalidCastException | Unable to convert value to type 'x' |
System.InvalidOperationException | This operator can only operate on properties of type 'string' |
var mgr = new DomainModelEntityManager(); var entityType = typeof(Customer); var rootQuery = EntityQuery.Create(entityType, mgr); // Two predicates - one a simple property, one a method var pd1 = new PredicateDescription(entityType, "OrderSummaries.Count()", FilterOperator.IsGreaterThan, 10); var pd2 = new PredicateDescription(entityType, "Country", FilterOperator.IsEqualTo, "USA"); var query = rootQuery.Where(pd1.And(pd2)); var results = query.Execute();
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