Converting an enitity class into an extented entity class

Posts   
 
    
siegemos
User
Posts: 47
Joined: 25-Jun-2007
# Posted on: 12-Mar-2008 16:37:46   

Hi all,

I Have implemented an extened entity class called ExtendedProductEntity, it inherits directly from a ProductEntity but has a few new properties on it.

The problem I'm having is that when I have a populated ProductCollection, I need to convert individual products from that collection in my new ExtendedProductEntities. Is there an easy way to do this? Ideally I only want to have to manuall initialize the extended properties rather than have to copy all of the base entity's property values over to the extended entity.

Thanks,

CJ.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 12-Mar-2008 17:20:01   

You can't cast from a superType to subType, but rather you should pass a factory class to the entityCollection CTor to create entities of subType.

Please check the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=12565