EntityFactory

Posts   
 
    
Jazz
User
Posts: 63
Joined: 12-Aug-2005
# Posted on: 12-Sep-2006 15:55:51   

Hello there, in LLBLGen 1.x there was an IEntity-Member called EntityFactoryToUse. I used that property to create new instances of the current IEntity which concrete type I don't know at that very moment.

Is it possible in V2.0 to achieve the same functionality in a simple way? I use .NET 2.0 & selfservicing...

Regards, André

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 12-Sep-2006 20:01:30   

Hi,

I guess you're talking about collections. You still have the EntityFactoryToUse property, and you can also use AddNew if you want to insert your new entity directly in the collection.

Cheers

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 13-Sep-2006 11:12:57   

You can also use the general entity factory class 'GeneralEntityFactory', which is generated in the entity factories file.

Use it like: IEntity newEntity = GeneralEntityFactory.Create((EntityType)someEntity.LLBLGenProEntityTypeValue);

Frans Bouma | Lead developer LLBLGen Pro
Jazz
User
Posts: 63
Joined: 12-Aug-2005
# Posted on: 13-Sep-2006 12:32:28   

That did it, thanks Frans.