Multiple nested scope registrations #327

Description
When doing multiple nested scopes through IServiceScopeFactory.CreateScope()
, you get nested IServiceProvider
instances. It doesn't, however, give access to registrations for each scope.
Therefore if you have scopes which are created further down the pipeline (with some service data only accessible from that step in the pipeline, which isn't available at the root), you can't really register services to use in there.
The sought-after structure being:
Scope (root)
- Register (root)
- Resolve (root level)
<- Scope (level 1)
- Register (level 1)
- Resolve (root level + level 1)
<- Scope (level 2)
- Register (level 2)
- Resolve (root level + level 1 + level 2)
I don't know if there's an alternative way of achieving this, but so far the documentation is scarce.