Sorting EntityCollection

Posts   
 
    
Posts: 13
Joined: 07-Jun-2005
# Posted on: 08-Feb-2006 22:16:32   

Is there a way to sort an entity collection based on a real type of the object in the collection?

For example, if I have a base class named "vehicle", with "truck" and "car" subclasses - and wanted to group the trucks and cars together in the entity collection (because I'm getting them all based on the base class) - how could I do this?

Is this type of information is lost when switching from a relational model to a the more oo approach with the new llbl (obviously not a LLBLGen specific issue).

Any help is greatly appreciated

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 09-Feb-2006 02:24:17   

I don't think there is a way for you to do this using the entitycollection. You would have to do it on your own.

Posts: 13
Joined: 07-Jun-2005
# Posted on: 09-Feb-2006 04:12:26   

thanks for the response. I honestly didn't think so. I can't imagine it never comes up though - future feature?? simple_smile

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 09-Feb-2006 07:04:27   
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 09-Feb-2006 09:18:00   

Or add a discriminator column to the entity. That field isn't used by LLBLGen Pro as a discriminatorcolumn but you can use it for these situations, so you can sort on that field, which groups them together, you can even do that directly in the query with a sortexpression.

Frans Bouma | Lead developer LLBLGen Pro