EFHooks
EFHooks copied to clipboard
Save another entity in PostInsertHook
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?