Dependency Injection Core Principles 1. Constructor injection is the default — Inject dependencies through the constructor (primary constructors make this clean). No service locator, no property injection. 2. Match lifetimes carefully — A singleton must never depend on a scoped or transient service. This is the most common DI bug. 3. Register interfaces, resolve interfaces — Register , not the concrete type. 4. Keyed services for strategy pattern — .NET 8+ keyed services replace manual factory patterns for selecting between implementations. Patterns Keyed Services (.NET 8+) Use keyed services…