How to cast EntityCollection<T> (generic) -> EntityCollection (non-generic)

Posts   
 
    
sherman
User
Posts: 9
Joined: 31-Jul-2007
# Posted on: 26-Mar-2009 17:28:42   

I need to cast an EntityCollection<MovEntity> that returns my BL to an EntityCollecion (winforms databinding):

BL method:

public EntityCollection<MovEntity> FetchCollection()

If I do in the GUI:

// collMovs is an EntityCollection
collMovs = MovManager.FetchCollection();

I receive: Cannot implicitly convert type 'Microserver.Integrador.DAL.HelperClasses.EntityCollection<Microserver.Integrador.DAL.EntityClasses.MovEntity>' to 'Microserver.Integrador.DAL.HelperClasses.EntityCollection'

I believe that the solution comes here: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=10908 ... but I don't fully understand flushed

Thank you so much for any help!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 26-Mar-2009 20:44:18   

Please use the interface: IEntityCollection2 instead simple_smile It's for non-generic programming against generic entity collections simple_smile

Frans Bouma | Lead developer LLBLGen Pro
sherman
User
Posts: 9
Joined: 31-Jul-2007
# Posted on: 27-Mar-2009 08:35:04   

Otis wrote:

Please use the interface: IEntityCollection2 instead simple_smile It's for non-generic programming against generic entity collections simple_smile

Thank you very much, great support!