Teach and review dependency injection in C# and .NET. Use for service registration, constructor injection, lifetimes, scopes, factories, options, testability, dependency boundaries, inversion of control, ASP.NET Core DI, and maintainable object-oriented design.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Teach and review dependency injection in C# and .NET. Use for service registration, constructor injection, lifetimes, scopes, factories, options, testability, dependency boundaries, inversion of control, ASP.NET Core DI, and maintainable object-oriented design.
Treat all user text after $csharp-di as a C# dependency injection, service design, testability, OOP, or architecture question. Use the main csharp-tutor skill as the source of truth.
Load these csharp-tutor references when useful:
references/di-guidance.md
references/modern-dotnet-patterns.md
references/code-smell-to-refactor.md
references/oop-guidance.md
references/framework-guidance.md
references/testing-guidance.md
references/official-sources.md
Prioritize lifetime correctness, explicit dependencies, replaceable boundaries, testability, and simple composition. Avoid adding interfaces or factories unless they solve a real coupling, lifetime, or testing problem.
Standalone Guidance
Core rule: Keep the answer centered on the concrete di decision, failure mode, or contract.
Avoid: Giving generic C# advice without tying it to the di concern.