← Back
Nick Chapsas May 8, 2025 8m

The Misunderstood Dependency Injection Lifetime in .NET

Summary

The transcript discusses dependency injection scopes in .NET, specifically focusing on the nuanced "scoped" lifetime between transient and singleton service registrations. The speaker demonstrates how changing a service's registration from transient to scoped affects object instantiation, showing that scoped services maintain a single instance within the same request context. The practical takeaway is that developers can leverage scoped lifetimes to control object creation and sharing across different components within a single request or operation, providing more granular control over dependency injection compared to traditional transient or singleton approaches.

View original episode ↗