Negative predicates

Posts   
 
    
DrM
User
Posts: 49
Joined: 09-Feb-2004
# Posted on: 06-Apr-2006 12:34:44   

I'm having a problem with the syntax for negative predicates. I have no problem getting the following straight LIKE to work:

Dim bucket As New RelationPredicateBucket bucket.PredicateExpression.Add(PredicateFactory.Like(ORM.ArbTableFieldIndex.URL, "%matchtextstring%"))

tempadapter.FetchEntityCollection(_arbCollection, bucket, 0, sorter1)

BUT as soon as I try the following syntax for negative predicates:

bucket.PredicateExpression.Add(Not PredicateFactory.Like(ORM.ArbTableFieldIndex.URL), "%matchtextstring%"))

I can't get VS.NET to accept the syntax - I get "The operator 'Not' is not defined for type 'SD.LLBLGen.Pro.ORMSupportClasses.FieldLikePredicate"

What am I missing?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 06-Apr-2006 15:48:27   

please use the Negate property in the FieldLikePredicate object.

FieldLikePredicate( IEntityField field, string pattern, bool negate );