Any examples in projects with multiple layers? #553
-
Any examples in projects with multiple layers? The scope needs to be created in the presentation layer, but the object to be monitored will be defined in another layer. Currently, when I do this, a new scope is created and the properties referring to the authenticated user are not generated in the event.  |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I managed to resolve. I shared my IHttpContextAcessor through a CrossCutting layer and then I can get the audit scope through the command below. ApiControllerExtensions.GetCurrentAuditScope(contextAccessor.HttpContext) I'm going to implement an abstraction for this right in the dependency injection. |
Beta Was this translation helpful? Give feedback.
I managed to resolve.
I shared my IHttpContextAcessor through a CrossCutting layer and then I can get the audit scope through the command below.
ApiControllerExtensions.GetCurrentAuditScope(contextAccessor.HttpContext)
I'm going to implement an abstraction for this right in the dependency injection.