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

Provides extension methods for setting up the service enrichers in an IServiceCollection.

ApplicationMetadataServiceCollectionExtensions

Extensions for application metadata.

AsyncStateExtensions

Extensions to manipulate async state.

AutoActivationExtensions

Extension methods for automatically activating singletons after application starts.

ClassWithInternalConstructor
CommonHealthChecksExtensions

Controls various health check features.

ContextualOptionsServiceCollectionExtensions

Extension methods for adding contextual options services to the DI container.

DefaultServiceProviderFactory

Default implementation of IServiceProviderFactory<TContainerBuilder>.

EncoderServiceCollectionExtensions

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

EnrichmentServiceCollectionExtensions

Lets you register telemetry enrichers in a dependency injection container.

EntityFrameworkCoreHealthChecksBuilderExtensions

IHealthChecksBuilder extension methods for Entity Framework Core.

ExceptionSummarizationServiceCollectionExtensions

Extensions to register exception summarization.

FakeLoggerServiceCollectionExtensions

Extensions for configuring fake logging, used in unit tests.

FakeRedactionServiceCollectionExtensions

Extensions that allow registering a fake redactor in the application.

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

Extension methods to configure an IServiceCollection for IHttpClientFactory.

HttpClientLatencyTelemetryExtensions

Extensions to add http client latency telemetry.

HttpClientLoggingHttpClientBuilderExtensions

Extensions to register extended HTTP client logging features.

HttpClientLoggingServiceCollectionExtensions

Extensions to register extended HTTP client logging features.

HttpDiagnosticsServiceCollectionExtensions

Extensions for telemetry utilities.

HybridCacheBuilderExtensions

Configuration extension methods for IHybridCacheBuilder / HybridCache.

HybridCacheServiceExtensions

Configuration extension methods for HybridCache.

KeyedService

Provides static APIs for use with IKeyedServiceProvider.

KubernetesProbesExtensions

Extensions for setting up probes for Kubernetes.

LatencyConsoleExtensions

Extensions to add console latency data exporter.

LatencyContextExtensions

Extensions to add latency context.

LatencyRegistryServiceCollectionExtensions

Extensions to configure a latency context.

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

Extensions to add a no-op latency context.

ObjectPoolServiceCollectionExtensions

Extension methods for adding ObjectPool<T> to DI container.

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

Provides extension methods for setting up Process enrichers in an IServiceCollection.

RedactionServiceCollectionExtensions

Extensions to register redaction functionality.

ResilienceHttpClientBuilderExtensions

Extensions for IHttpClientBuilder.

ResilienceServiceCollectionExtensions

Extension class for the Service Collection DI container.

ResourceMonitoringServiceCollectionExtensions

Lets you configure and register resource monitoring components.

ResourceUtilizationHealthCheckExtensions

Controls resource utilization health check features.

ServiceCollection

Default implementation of IServiceCollection.

ServiceCollectionContainerBuilderExtensions

Extension methods for building a ServiceProvider from an IServiceCollection.

ServiceCollectionHostedServiceExtensions

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

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

Extension methods to configure SocketsHttpHandler for a 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.

TcpEndpointProbesExtensions

Extension methods for setting up TCP-based health check probes.

Structs

AsyncServiceScope

An 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

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

IServiceScope

Defines a disposable service scope.

IServiceScopeFactory

Creates instances of IServiceScope, which is used to create services within a scope.

ISocketsHttpHandlerBuilder

Configures SocketsHttpHandler for a 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.