EntityView

Posts   
 
    
Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 29-Oct-2006 22:41:38   

Hi,

Is it possible to define an EntityView for the first and second half of an entity collection? Say filter on the collection's index?

Cheers, Ian.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 30-Oct-2006 07:49:19   

Filtering and sorting an EntityView is done through normal LLBLGen Pro predicate and sortclause classes.

What you want can be done by copying entities to new collections. You don't need filtering through EntityViews.

In another words: EntityViews are used to find out those entities according to a specific criteria.(find out = find their indexes within a collection). So if you already know their indexes, then you don't need an entity view to filter them out.

Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 30-Oct-2006 13:53:48   

Ok, but the first half of a collection is a specific criteria.

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 30-Oct-2006 15:45:01   

Hi,

you can build custom predicates for in memory filtering, which are not directly based on entity fields (see "Using entityviews with entity collections - Filtering using multiple predicates" in the manual). The index in collection should be available through the ParentCollection property but it is internal so you can't make up your custom property descriptor out of it.

If you're wishing to edit and rebuild the core, then there should be a solution, but I think it's a bit overkill.

You might have a simpler way to convert your indexing constraint in a regular filter, or simply use walaa's suggestion.

Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 30-Oct-2006 21:00:14   

Yeah I think I will stick with two new collections.