2005.1 and recursive Saves

Posts   
 
    
beekde
User
Posts: 14
Joined: 08-Jul-2005
# Posted on: 04-Nov-2005 23:25:57   

Just upgraded to the latest version and I have a question. I was overriding the SaveEntity function in order to do some validation per entity. This worked really well with recursive saves because I could validate every entity about to be saved. With the latest version it appears SaveEntity doesn't get called for the related entities in this recusive manner. I am aware of IEntityValidator but would prefer not to rework all my validation logic and exception handeling. Does anyone have a suggestion as to how I can hook into the recursive save routine?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 05-Nov-2005 11:56:46   

You should override BeforeEntitySave now instead. OnBeforeEntitySaveis called before the entity is actually send off to the query producer. Because the logic has been changed internally, SaveEntity is not called recursively: a queue is build up front and that queue is persisted. To be able to intercept a save of an entity, OnBeforeEntitySaveis added.

See also 'Migrating your code' in the documentation, under 'Adapter'.

Frans Bouma | Lead developer LLBLGen Pro