Microsoft.Extensions.DependencyInjection Namespace

Provides classes that support the implementation of the dependency injection software design pattern.

Classes

ActivatorUtilities

Helper code for the various activator services.

ActivatorUtilitiesConstructorAttribute

Marks the constructor to be used when activating type using ActivatorUtilities.

ApplicationEnricherServiceCollectionExtensions
ApplicationMetadataServiceCollectionExtensions
AsyncStateExtensions
AutoActivationExtensions
CommonHealthChecksExtensions
ContextualOptionsServiceCollectionExtensions
DefaultServiceProviderFactory

Default implementation of IServiceProviderFactory<TContainerBuilder>.

EncoderServiceCollectionExtensions

Extension methods for setting up web encoding services in an IServiceCollection.

EnrichmentServiceCollectionExtensions
EntityFrameworkCoreHealthChecksBuilderExtensions
ExceptionSummarizationServiceCollectionExtensions
FakeLoggerServiceCollectionExtensions
FakeRedactionServiceCollectionExtensions
FromKeyedServicesAttribute

Indicates that the parameter should be bound using the keyed service registered with the specified key.

HealthChecksBuilderAddCheckExtensions

Provides basic extension methods for registering IHealthCheck instances in an IHealthChecksBuilder.

HealthChecksBuilderDelegateExtensions

Provides extension methods for registering delegates with the IHealthChecksBuilder.

HealthCheckServiceCollectionExtensions

Provides extension methods for registering HealthCheckService in an IServiceCollection.

HttpClientBuilderExtensions

Extension methods for configuring an IHttpClientBuilder.

HttpClientFactoryServiceCollectionExtensions

Extensions methods to configure an IServiceCollection for IHttpClientFactory.

HttpClientLatencyTelemetryExtensions
HttpClientLoggingHttpClientBuilderExtensions
HttpClientLoggingServiceCollectionExtensions
HttpDiagnosticsServiceCollectionExtensions
KeyedService

Provides static APIs for use with IKeyedServiceProvider.

KubernetesProbesExtensions
LatencyConsoleExtensions
LatencyContextExtensions
LatencyRegistryServiceCollectionExtensions
LocalizationServiceCollectionExtensions

Extension methods for setting up localization services in an IServiceCollection.

LoggingServiceCollectionExtensions

Extension methods for setting up logging services in an IServiceCollection.

MemoryCacheServiceCollectionExtensions

Extension methods for setting up memory cache related services in an IServiceCollection.

MetricsServiceExtensions

Extension methods for setting up metrics services in an IServiceCollection.

NullLatencyContextServiceCollectionExtensions
ObjectPoolServiceCollectionExtensions
OptionsBuilderConfigurationExtensions

Extension methods for adding configuration related options services to the DI container via OptionsBuilder<TOptions>.

OptionsBuilderDataAnnotationsExtensions

Extension methods for adding configuration-related options services to the DI container via OptionsBuilder<TOptions>.

OptionsBuilderExtensions

Extension methods for adding configuration related options services to the DI container via OptionsBuilder<TOptions>.

OptionsConfigurationServiceCollectionExtensions

Extension methods for adding configuration related options services to the DI container.

OptionsServiceCollectionExtensions

Extension methods for adding options services to the DI container.

PollyHttpClientBuilderExtensions

Extensions methods for configuring PolicyHttpMessageHandler message handlers as part of and HttpClient message handler pipeline.

PollyServiceCollectionExtensions

Provides convenience extension methods to register IPolicyRegistry<TKey> and IReadOnlyPolicyRegistry<TKey> in the service collection.

ProcessEnricherServiceCollectionExtensions
RedactionServiceCollectionExtensions
RedisCacheServiceCollectionExtensions

Extension methods for setting up Redis distributed cache related services in an IServiceCollection.

ResilienceHttpClientBuilderExtensions
ResilienceServiceCollectionExtensions
ResourceMonitoringServiceCollectionExtensions
ResourceUtilizationHealthCheckExtensions
ServiceCollection

Default implementation of IServiceCollection.

ServiceCollectionContainerBuilderExtensions

Extension methods for building a ServiceProvider from an IServiceCollection.

ServiceCollectionHostedServiceExtensions

Provides extension methods for adding hosted services to an IServiceCollection.

ServiceCollectionServiceExtensions

Extension methods for adding services to an IServiceCollection.

ServiceDescriptor

Describes a service with its service type, implementation, and lifetime.

ServiceKeyAttribute

Specifies the parameter to inject the key that was used for registration or resolution.

ServiceProvider

The default IServiceProvider.

ServiceProviderKeyedServiceExtensions

Provides extension methods for getting services from an IServiceProvider.

ServiceProviderOptions

Options for configuring various behaviors of the default IServiceProvider implementation.

ServiceProviderServiceExtensions

Extension methods for getting services from an IServiceProvider.

SocketsHttpHandlerBuilderExtensions

Provides extension methods to configure SocketsHttpHandler for named HttpClient instances returned by IHttpClientFactory.

SqlServerCachingServicesExtensions

Extension methods for setting up Microsoft SQL Server distributed cache services in an IServiceCollection.

StackExchangeRedisCacheServiceCollectionExtensions

Extension methods for setting up Redis distributed cache related services in an IServiceCollection.

Structs

AsyncServiceScope

A IServiceScope implementation that implements IAsyncDisposable.

Interfaces

IHealthChecksBuilder

A builder used to register health checks.

IHttpClientBuilder

A builder for configuring named HttpClient instances returned by IHttpClientFactory.

IKeyedServiceProvider

Retrieves services using a key and a type.

IServiceCollection

Specifies the contract for a collection of service descriptors.

IServiceProviderFactory<TContainerBuilder>

Provides an extension point for creating a container specific builder and an IServiceProvider.

IServiceProviderIsKeyedService

Provides methods to determine if the specified type with the specified service key is available from the IServiceProvider.

IServiceProviderIsService

Optional service used to determine if the specified type is available from the IServiceProvider.

IServiceScope

The Dispose() method ends the scope lifetime. Once Dispose is called, any scoped services that have been resolved from ServiceProvider will be disposed.

IServiceScopeFactory

A factory for creating instances of IServiceScope, which is used to create services within a scope.

ISocketsHttpHandlerBuilder

Configures SocketsHttpHandler for named HttpClient instances returned by IHttpClientFactory.

ISupportRequiredService

Optional contract used by GetRequiredService<T>(IServiceProvider) to resolve services if supported by IServiceProvider.

Enums

ServiceLifetime

Specifies the lifetime of a service in an IServiceCollection.

Delegates

ObjectFactory

The result of CreateFactory(Type, Type[]).

ObjectFactory<T>

Returns the result of CreateFactory<T>(Type[]), which is a delegate that specifies a factory method to call to instantiate an instance of type T.