Dependency Injection Patterns · Aaronontheweb/dotnet-skills

Organize .NET DI registrations into extension methods

Groups related service registrations into composable IServiceCollection extension methods instead of one long Program.cs. Useful when organizing dependency injection in ASP.NET Core apps or libraries and reusing the same configuration in tests.

Good for

  • Split a large Program.cs into extension methods
  • Group related services into one Add* method
  • Reuse DI configuration between production and test code
Category
General

Open-source skills are maintained by their authors and listed as published, with attribution. Results depend on how well the skill fits your task and material.

A good place to start

Help me refactor my Program.cs by grouping related service registrations into IServiceCollection extension methods.

Make your next great thing.

Bring a question, a file, or an idea that’s not quite there yet.