What problem does it solve?
Dependency injection failures in .NET cause runtime bugs, memory leaks, and brittle service composition when lifetimes are mismatched or when the wrong registration strategy is used.
Core Features & Use Cases
- Lifetime-safe service registration: Prevents singleton/scoped capture issues and enforces correct lifetime choices for DbContext and other dependencies.
- Modern DI patterns: Applies keyed services for strategy routing, decorator wrapping for cross-cutting concerns, and factory delegates for runtime selection.
- Convention-based wiring: Uses Scrutor-style registration-by-convention to reduce boilerplate and keep interfaces aligned with implementations.
- Options binding for typed configuration: Loads configuration into strongly typed options with validation for predictable runtime behavior.
Quick Start
Load the dependency-injection skill when you register services or debug DI errors by asking: "Show me the correct lifetimes and registration pattern for my IServiceCollection setup, and refactor it to use keyed services or decorators where appropriate."