EntityCollection.Sort()

Posts   
 
    
BigVee
User
Posts: 6
Joined: 23-Mar-2006
# Posted on: 22-Aug-2006 04:03:11   

Is there any way to sort an entity collection (after fetching it) by two (or more) fields?

I can only see a way to sort it by one... and doing two sorts one after another doesn't help either. Thanks.

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 22-Aug-2006 06:22:29   

Assuming VS2005 and LLBLGen 2.0, you can use an EntityView2 and specify a sorter.

see the thread at http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7316&StartAtMessage=0#40235 for one way of doing it.

Be sure that you really "care" that the entitycollection itself is sorted. The EntityView as a view on a collection is probably the best solution in many cases.

BigVee
User
Posts: 6
Joined: 23-Mar-2006
# Posted on: 22-Aug-2006 08:12:14   

Sorry I should have mentioned... It's LLBLGen Pro Version 1.0.2005.1 Final. In conjunction with C# & ASP.NET 2.0

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-Aug-2006 08:16:43   

There is no built in way of doing it in 1.0.2005.1 Maybe you want to develop the sorting logic yourself, create a method that takes an entityCollection and returns the sorted one.