EntityCollection per entity

Posts   
 
    
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 20-Jul-2006 10:59:20   

Suggestion for Adapter scenario: It would be nice to have an option to generate non-generic EntityCollection (that derive from generic EntityCollection<>) per Entity. This way one could add methods and properties to collections.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 20-Jul-2006 11:58:08   

and when would you use these collections, also in situations like Customer.Orders ?

Using 1 collection made the code more cleaner actually.

Frans Bouma | Lead developer LLBLGen Pro
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 20-Jul-2006 13:28:14   

Otis wrote:

and when would you use these collections, also in situations like Customer.Orders ?

Sure.

Otis wrote:

Using 1 collection made the code more cleaner actually.

That's true, but it also means that you can't extend specific collections (using partial classes) and you always have to pass a factory instance. For example, I would add a method FindByOrderType to OrdersCollection for example. Anyway, I already added such template and modifed templates to make it work for me.