DoNotPerformAddIfPresent

Posts   
 
    
jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 22-Feb-2010 19:19:35   

is there a way to set this globally for self service? I need it to be true but it looks like i need to set it per collection. we have a lot of abstraction in our app and i can set it for the parent collection, but it's going to require reflection or something similar to set it for all child collections on the parent entity. is there a way to do it either globally or though the prefetch path?

thanks

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 23-Feb-2010 06:11:55   

You can create a class that inherit from EntityCollectionBase. Then you can make your classes derive from your new EntityCollectionBaseCustom. There you can put your customization (set the flag on the OnInitialize method). You can modify your templates to make you entities inherit from the new collectionBase.

You also can download the sourceCode and make your little custom changes to the ORM code.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 23-Feb-2010 11:56:38   

Another way is to use a custom template for the entitycollections and set the flag in the ctor of the generated collections.

It's not recommended to set this flag to true on a global scale as it will hurt performance when you add an entity to the collection.

Frans Bouma | Lead developer LLBLGen Pro