I'm playing around with the new Microsoft DI and am trying to implement this in my project. I'm looking for examples on is how to implement a chain of 2 nested scopes from a the (shared) root ServiceCollection, like so: Root -> Level 1 -> Level 2. This would mean that the Root level resolves services as usual, level 1 resolves from level 1 and root, and level 2 resolves from level 2, level 1 and root, respectively.
IServiceScopeFactory.CreateScope gives me access to a scoped ServiceProvider, but what do I do when I want to register a service exclusively for that scope? I only have access to the root ServiceCollection, but not one for my scopes, only the provider.
Does the Microsoft DI support this kind of scoping? All suggestions are welcome.