Base solution for your next web application
BLACK FRIDAY
From Nov 21
To Dec 1
XXDAYS : XXHRS : XXMIN : XXSEC
SAVE UP TO$3K
Also valid for the
existing customers!
Open Closed

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


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)