EFHooks icon indicating copy to clipboard operation
EFHooks copied to clipboard

Save another entity in PostInsertHook

Open gentisaliu opened this issue 11 years ago • 0 comments

I would like to be able to create and save a new entity in another entity's PostInsertHook Hook-method, but I do not want to create a new DbContext instance. My use case: for every item I create (in an Item table), I want to create a log entry (in a Log table) to track its creation.

From what I can see, there is no way to access the current DbContext inside the Hook itself.

Can you recommend a solution which is feasible with the EFHooks framework?

gentisaliu avatar Jul 17 '13 09:07 gentisaliu