Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
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)