0
hra created
I have a service which is consumed by both my web request logic, and my background job - yes it maintains some state during the operation.
I was using "IPerWebRequestDependency" scope - which is fine for the web request - but in my background worker, every dependent of this service gets its own (transient) instance.
How do I register this service to behave the same for both?
Thanks,
1 Answer(s)
-
0
Hi @hra
Have you tried ASP.NET Core's ScopedDependency https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-6.0 ?