Base solution for your next web application
Open Closed

How to scope a service to both "web request" and "background job" #10833


User avatar
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)