Using Scoped Services From Singletons in ASP.NET Core
Did you ever need to inject a scoped service into a singleton service?
I often need to resolve a scoped service, like the EF Core DbContext, in a background service.
Another example is when you need to resolve a scoped service in ASP.NET Core middlew...
milanjovanovic.hashnode.dev4 min read