A ‘Captive Dependency’ happens when a Singleton service depends on a Scoped service. This can lead to memory leaks and incorrect state. Learn how to use IServiceScopeFactory to handle this correctly.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
A ‘Captive Dependency’ happens when a Singleton service depends on a Scoped service. This can lead to memory leaks and incorrect state. Learn how to use IServiceScopeFactory to handle this correctly.