Default Sort Order of Collection Properties in SelfServicing Code

Posts   
 
    
morcs
User
Posts: 5
Joined: 17-Nov-2005
# Posted on: 29-Nov-2005 12:03:09   

I've searched the forum and documentation but I can't find an answer to this.

Is there any way to set a default ordering for collection properties (in self-servicing code)? For example a way of saying that the Customer.Orders collection should by default always be ordered by Order.Date?

At the moment I'm using SetCollectionParametersOrders to set the ordering, but often the collection will have already been populated using the arbitrary order returned by the database query, meaning I have to refetch the collection.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 29-Nov-2005 14:43:19   

you should include a template bound to Custom_EntityInitializationTemplate

Please refer to the "Include templates" section under "Using the generated code - Adding your own code to the generated classes" in the LLBLGen Pro Documentation.