Replies: 1 comment 1 reply
-
Even if there was a way to extend the You can also access the custom field dictionary directly: scope.Event.CustomFields["UserId"] = userId; Or even inside the WebApi Action: (scope.Event as Audit.WebApi.AuditEventWebApi).Action.CustomFields["UserId"] = userId; Anyway I'll think a little bit more about this |
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
-
I've got a question of whats possible with the current library. We are planning on using the AuditApi attributes to audit incoming requests. We would like to be able to extend the AuditEventWebApi event to be able to easily add some additional fields to the event being saved. Currently we can also do it using
scope.SetCustomField(nameof(CreateSubscriptionAuditEvent.UserId), userId);
It would be nice however to be able to do:
scope.Event.UserId = userId;
Is there a way to extend the AuditEventWebApi when using the AuditApi attribute?
I did a little digging and i don't see a way to override an ActionType so it will always add my custom eventtype, also the attribute news up an AuditEventWebApi by the looks of it. But maybe im missing something?
Thanks for the nice library!
Beta Was this translation helpful? Give feedback.
All reactions