How would you configure this library in a DI driven application? #689
Unanswered
silvanknecht
asked this question in
Q&A
Replies: 1 comment
-
It depends on which extensions are you using to generate the events. Some of the extensions for generating events, such as Audit.EntityFramework.Core, Audit.WebApi.Core, Audit.Mvc.Core, and Audit.SignalR, will automatically attempt to resolve the services.AddScoped<IAuditScopeFactory, AuditScopeFactory>();
services.AddSingleton<AuditDataProvider>(new FileDataProvider(cfg => cfg.Directory(@"C:\Logs")) https://github.com/thepirat000/Audit.NET/blob/master/README.md#audit-scope-factory |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Our current applications are all DI-driven and I'd like to know what you would assume is the cleanest way to configure this static service in a DI-driven world (with HostBuilder, ConfigureService(), etc...). The main reason is that we want to use the the option pattern to configure the service.
Beta Was this translation helpful? Give feedback.
All reactions