IServiceCollection
The list of service registrations the dependency injection container is built from, reached in ASP.NET Core as builder.Services.
In more detail
Once the host is built, the collection becomes read-only and is turned into a service provider. Every AddX extension method, such as AddOpenApi or AddDbContext, adds registrations to it and returns it so calls chain.
Related terms
- service registration — Telling the dependency injection container which implementation, with which lifetime, should satisfy requests for a service type.
- service provider — The built dependency injection container, which creates and hands out services according to their registrations.
- extension method — A static method whose first parameter is marked this, so it can be called as though it were an instance method of that type.
Taught in
- Classes, Interfaces, and Object-Oriented C# — Modern .NET Core, C# & Enterprise Microservices
- The Dependency Injection Container: Scopes and Lifetimes — Modern .NET Core, C# & Enterprise Microservices
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices