Closed sungam3r closed 4 years ago
@sungam3r thanks for contacting us.
@anurse is platform the right area for these types of things?
@javiercn it belongs in extensions and eventually runtime.
What is the reason for this behavior?
It's an internal implementation detail of the service provider. The top level service provider instance isn't the same instance given to you when you resolve singleton services but it is backed by the same data.
We hand the call back an ServiceProviderEngineScope
vs the top level ServiceProvider
instance.
but it is backed by the same data
Do you mean that both instances share the same set of resolved services?
Yes
Transferred to dotnet/extensions.
Sounds like the question has been answered. Closing.
I have been working with DI for quite some time but still don’t understand some things.
Given that example:
I get this result:
What is the reason for this behavior?