Microsoft.Extensions.DependencyInjection

Provides fundamental types and interfaces for implementing a dependency injection container.

This namespace is central to the .NET Core and .NET 5+ application development model, enabling services to be registered and resolved throughout an application's lifecycle.

Classes

ServiceCollection
Represents a collection of service descriptors that can be used to create a service provider.
ServiceProvider
Represents a service provider that can be used to resolve services.
ServiceProviderOptions
Options for configuring the behavior of a ServiceProvider.
ServiceLifetime
Specifies the lifetime of a service.

Interfaces

IServiceCollection
Represents a collection of service descriptors.
IServiceProvider
Represents a service provider that can be used to resolve services.
IServiceScope
Represents a scope for resolving services from an IServiceProvider.
IServiceScopeFactory
Creates an IServiceScope.
IServiceDescriptor
Describes a service registration.

Enums

ServiceLifetime
Specifies the lifetime of a service.