can we make EntityCollection<> generic?

Posts   
 
    
youkebb
User
Posts: 14
Joined: 14-May-2009
# Posted on: 28-May-2009 19:23:33   

I know we can provide specific entity type to the collection, what I am trying to do is to create a method which has a parameter of EntityCollection<>, something like following

private void Test(EntityCollection<T> gen)

so that I can make it generic and cast it to different types. How can we do this in LLBLGen? Any suggestion will be appreciated.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 28-May-2009 19:52:18   

You can use the interface (IEntityCollection) to represent an unknown type.

Matt

youkebb
User
Posts: 14
Joined: 14-May-2009
# Posted on: 28-May-2009 20:32:54   

MTrinder wrote:

You can use the interface (IEntityCollection) to represent an unknown type.

Matt

hi I don't exactly know what you mean. Shell I do something like EntityCollection<IEntityCollection> ? Thanks.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 28-May-2009 20:36:42   
private void Test(IEntityCollection coll)

You should then be able to pass any entity collection to it

Matt

youkebb
User
Posts: 14
Joined: 14-May-2009
# Posted on: 28-May-2009 20:49:23   

alright I think what you meant is to use IEntityCollection2

this signature will work fine:

private void Test(IEntityCollection2 coll)

what's the difference between the two? i've been noticing that we have a bunch of xxxx2's in the project, for example IEntity2, EntityBase2 and this IEntityCollection2.

Anyways my problem has been solved. Thank you very much

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 29-May-2009 10:15:15   

Anything with a 2 on the end is Adapter specific, anything without is generic or SelfServicing only.

Glad it's working.

Matt