title: .Net Core Dependency Injection - replace dependency within a child scope
body: <p>I'm using a default .Net Core DI (Microsoft.Extensions.DependencyInjection). I need to resolve a service replacing a particular dependency with another instance. In my case it's a db connection so it's not a first-level dependency. For now the only working solution I found is to create a new service provider from scratch but it looks like a huge overhead to me. Is there a way to inherit an existing configuration replacing a single interface implementation? <code>IServiceProvider</code> and <code>IServiceScopeFactory</code> interfaces don't have any methods to modify anything.</p>