not in between to predicates

Posts   
 
    
banusi
User
Posts: 43
Joined: 08-Jul-2006
# Posted on: 07-Jul-2008 10:32:49   

I have a collection with data.

Example id from 1 to 10

The first filter gives me 1,4,5,6,7

The second filter gives me 1,2,3,4,5,6,7

So the second filter gives me the same as filter 1 and then some extra

I wan't to make a third filter which gives me 2,3

So all from 2 except all from 1.

How can I make this set operation. I use 2.5.

The filter from 1 and 2 are very long and complicated. But the thing i wan't is set operation on the class predicate

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 07-Jul-2008 11:09:17   

Your question is not clear.

Do you want to get a collection of entities which exist in one collection but not on another? You may loop the first collection and use FindMatches() on the second collection, to see which entity exist in the smaller collection and which is not.

banusi
User
Posts: 43
Joined: 08-Jul-2006
# Posted on: 07-Jul-2008 11:16:38   

Filter 1 contains some elements from data

Filter 2 contains all elements from filter 1 and then some extra

What I want is the extra elements

So all elements from filter 2 except all elements in filter 1.

Is it possible to use FieldCompareSetPredicate.

Filter 2 is born with the statement

group2filter.Add(new FieldCompareSetPredicate(PakkelisteHistorikFields.FaktOrg, null, PakkelisteHistorikFields.FaktOrg, null, SetOperator.In, group1filter));

Is it possible to see the filter expression in text, because the filter code is complex for me?

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 07-Jul-2008 14:19:26   

If you want to select (with filter) from another select query (derived table). Then you need to check the "derived table" new feature in v.2.6.link