public class MySingleton
{
public MySingleton(MyScopedService s) { }
}
❌ Problem
-
Captures first request scope forever
-
Causes stale data & memory leaks
✅ Fix
Use IServiceScopeFactory.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
public class MySingleton
{
public MySingleton(MyScopedService s) { }
}
Captures first request scope forever
Causes stale data & memory leaks
Use IServiceScopeFactory.