FieldLikePredicate

Posts   
 
    
ronny
User
Posts: 5
Joined: 07-Feb-2007
# Posted on: 07-Feb-2007 10:24:44   

hey guys,

I'm trying to create a FieldLikePredicate similar to sql WHERE artist NOT LIKE "piet%". 2 questions for you:

1 How can i implement the "not" part of the sql in the FieldLikePredicate. 2 I cannot pass a IEntityField2 field in the first parameter, only IEntityField, why is that?

thanks in advance.

Greetz ronny

Edit: Got it: new FieldLikePredicate(MediaTracksFields.Title, null,criteria, true);

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 07-Feb-2007 15:14:19   

EntityField2 is when in the Adapter model, while EntityField is used in the SelfServicing model.

For negation you can also use the following:

filter.Add( ! (MediaTracksFields.Title % "piet%"));