IServiceScopeFactory
2 posts2 contributors
+ FollowBe the first to follow this
Write about itArticles about IServiceScopeFactory

The ASP.NET Core Dependency Injection System (with .NET 9 Patterns & Pitfalls)
Practical guide to ASP.NET Core DI: lifetimes, constructor vs. property injection, Options, TryAdd, avoiding captive deps, IServiceScopeFactory, IAsyncDisposable, and .NET 9 AOT.

Understanding IServiceScopeFactory in .NET: When, Why, and How to Use It (With Real Examples)
IServiceScopeFactory in .NET enables the manual creation of scoped services, allowing singletons and background tasks to safely utilize scoped dependencies. This ensures proper disposal, prevents memory leaks, and maintains DI lifetimes.

