Extend Entity Framework workflows to allow handling both before and after save #561
Danielku15
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Actually, when you set It depends on the data provider you are using, but the first time it will call the Insert/InsertAsync and the second will call Replace/ReplaceAsync on the data provider. Also, you could use Custom Actions to act upon saving events, for example: Audit.Core.Configuration.AddCustomAction(ActionType.OnScopeCreated, scope =>
{
});
Audit.Core.Configuration.AddCustomAction(ActionType.OnEventSaving, scope =>
{
});
Audit.Core.Configuration.AddCustomAction(ActionType.OnEventSaved, scope =>
{
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently you have to decide whether you want to handle workflows before or after save. We are using the Audit events not only to simply persist them using a custom
AuditDataProvider
but we also use it as internal signaling mechanism that things have been changed and trigger actions based on it.Now we have the use case that before saving we might want to use the information of Audit.net to react upon certain changes and additoinally modify things or trigger actions. e.g. handle some transitive changes.
And after the changes have been saved we want to persist the final done changes.
It would be great if we can simply tell Audit.net to signal our provider both before and after the save changes. Currently there is only SetEarlySavingAudit which allows you to choose whether you want to have it before or after saving.
We are currently trying to make an own interceptor replicating the default
AuditSaveChangesInterceptor
andDbContextHelper
behavior but signaling at both times.Beta Was this translation helpful? Give feedback.
All reactions