18 instantiations of ServiceDescriptor
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
66var dbContextOptionsDescriptor = new ServiceDescriptor(
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
66var dbContextOptionsDescriptor = new ServiceDescriptor(
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
66var dbContextOptionsDescriptor = new ServiceDescriptor(
Aspire.Oracle.EntityFrameworkCore (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
66var dbContextOptionsDescriptor = new ServiceDescriptor(
Aspire.Pomelo.EntityFrameworkCore.MySql (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
66var dbContextOptionsDescriptor = new ServiceDescriptor(
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
DatabaseDeveloperPageExceptionFilterServiceExtensions.cs (1)
30services.TryAddEnumerable(new ServiceDescriptor(typeof(IDeveloperPageExceptionFilter), typeof(DatabaseDeveloperPageExceptionFilter), ServiceLifetime.Singleton));
Microsoft.Extensions.DependencyInjection.Abstractions (12)
ServiceCollectionServiceExtensions.cs (3)
460var serviceDescriptor = new ServiceDescriptor(serviceType, implementationInstance); 491var descriptor = new ServiceDescriptor(serviceType, implementationType, lifetime); 502var descriptor = new ServiceDescriptor(serviceType, implementationFactory, lifetime);
ServiceCollectionServiceExtensions.Keyed.cs (3)
509var serviceDescriptor = new ServiceDescriptor(serviceType, serviceKey, implementationInstance); 543var descriptor = new ServiceDescriptor(serviceType, serviceKey, implementationType, lifetime); 555var descriptor = new ServiceDescriptor(serviceType, serviceKey, implementationFactory, lifetime);
ServiceDescriptor.cs (6)
914return new ServiceDescriptor(serviceType, implementationInstance); 934return new ServiceDescriptor(serviceType, serviceKey, implementationInstance); 964return new ServiceDescriptor(serviceType, implementationType, lifetime); 983return new ServiceDescriptor(serviceType, serviceKey, implementationType, lifetime); 997return new ServiceDescriptor(serviceType, implementationFactory, lifetime); 1012return new ServiceDescriptor(serviceType, serviceKey, implementationFactory, lifetime);
739 references to ServiceDescriptor
Aspire.Azure.AI.OpenAI (2)
AspireAzureOpenAIExtensions.cs (1)
55/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
AspireConfigurableOpenAIExtensions.cs (1)
56/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Azure.Data.Tables (1)
AspireTablesExtensions.cs (1)
48/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Azure.Messaging.EventHubs (5)
AspireEventHubsExtensions.cs (5)
45/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param> 87/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param> 129/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param> 172/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param> 215/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Azure.Messaging.ServiceBus (1)
AspireServiceBusExtensions.cs (1)
47/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Azure.Messaging.WebPubSub (1)
AspireWebPubSubExtensions.cs (1)
47/// <param name="serviceKey">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service, as well as the hub name is hub name is not set in the settings</param>
Aspire.Azure.Search.Documents (1)
AspireAzureSearchExtensions.cs (1)
47/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Azure.Security.KeyVault (1)
AspireKeyVaultExtensions.cs (1)
50/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection information from the ConnectionStrings configuration section.</param>
Aspire.Azure.Storage.Blobs (1)
AspireBlobStorageExtensions.cs (1)
48/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Azure.Storage.Queues (1)
AspireQueueStorageExtensions.cs (1)
49/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Confluent.Kafka (2)
AspireKafkaConsumerExtensions.cs (1)
93/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
AspireKafkaProducerExtensions.cs (1)
93/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Dashboard (2)
DashboardWebApplication.cs (2)
247builder.Services.TryAddEnumerable(ServiceDescriptor.Scoped<IOutgoingPeerResolver, ResourceOutgoingPeerResolver>()); 248builder.Services.TryAddEnumerable(ServiceDescriptor.Scoped<IOutgoingPeerResolver, BrowserLinkOutgoingPeerResolver>());
Aspire.Elastic.Clients.Elasticsearch (1)
AspireElasticClientsElasticsearchExtensions.cs (1)
46/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Hosting (9)
Dashboard\DashboardServiceHost.cs (1)
107builder.Services.Add(ServiceDescriptor.Singleton(typeof(ILogger<>), typeof(Logger<>)));
DistributedApplicationBuilder.cs (6)
270_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<TransportOptions>, TransportOptionsValidator>()); 275_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<DashboardOptions>, ConfigureDefaultDashboardOptions>()); 276_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<DashboardOptions>, ValidateDashboardOptions>()); 283_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<DcpOptions>, ConfigureDefaultDcpOptions>()); 284_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<DcpOptions>, ValidateDcpOptions>()); 292_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<CodespacesOptions>, ConfigureCodespacesOptions>());
Lifecycle\LifecycleHookServiceCollectionExtensions.cs (2)
31services.TryAddEnumerable(ServiceDescriptor.Singleton<IDistributedApplicationLifecycleHook, T>()); 53services.TryAddEnumerable(ServiceDescriptor.Singleton<IDistributedApplicationLifecycleHook, T>(implementationFactory));
Aspire.Hosting.Testing (5)
DistributedApplicationFactory.cs (5)
393var hostDescriptor = applicationBuilder.Services.Single(s => s.ServiceType == typeof(IHost) && s.ServiceKey is null); 397var interceptedDescriptor = hostDescriptor switch 399{ ImplementationFactory: { } factory } => ServiceDescriptor.KeyedSingleton<IHost>(this, (sp, _) => (IHost)factory(sp)), 400{ ImplementationInstance: { } instance } => ServiceDescriptor.KeyedSingleton<IHost>(this, (IHost)instance), 401{ ImplementationType: { } type } => ServiceDescriptor.KeyedSingleton(typeof(IHost), this, type),
Aspire.Microsoft.Azure.Cosmos (1)
AspireMicrosoftAzureCosmosExtensions.cs (1)
44/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Microsoft.Data.SqlClient (1)
AspireSqlServerSqlClientExtensions.cs (1)
39/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Microsoft.EntityFrameworkCore.Cosmos (5)
src\Components\Common\EntityFrameworkUtils.cs (5)
34public static ServiceDescriptor CheckDbContextRegistered<TContext>(this IHostApplicationBuilder builder, [CallerMemberName] string memberName = "") 41var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>)); 57var oldDbContextOptionsDescriptor = builder.CheckDbContextRegistered<TContext>(memberName); 66var dbContextOptionsDescriptor = new ServiceDescriptor( 97var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>));
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (1)
EnrichCosmosDbTests.cs (1)
113var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
Aspire.Microsoft.EntityFrameworkCore.SqlServer (5)
src\Components\Common\EntityFrameworkUtils.cs (5)
34public static ServiceDescriptor CheckDbContextRegistered<TContext>(this IHostApplicationBuilder builder, [CallerMemberName] string memberName = "") 41var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>)); 57var oldDbContextOptionsDescriptor = builder.CheckDbContextRegistered<TContext>(memberName); 66var dbContextOptionsDescriptor = new ServiceDescriptor( 97var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>));
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (5)
EnrichSqlServerTests.cs (5)
123var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 161var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 167var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 204var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 254var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
Aspire.MongoDB.Driver (1)
AspireMongoDBDriverExtensions.cs (1)
48/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.MySqlConnector (1)
AspireMySqlConnectorExtensions.cs (1)
40/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.NATS.Net (1)
AspireNatsClientExtensions.cs (1)
47/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Npgsql (1)
AspirePostgreSqlNpgsqlExtensions.cs (1)
40/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (5)
src\Components\Common\EntityFrameworkUtils.cs (5)
34public static ServiceDescriptor CheckDbContextRegistered<TContext>(this IHostApplicationBuilder builder, [CallerMemberName] string memberName = "") 41var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>)); 57var oldDbContextOptionsDescriptor = builder.CheckDbContextRegistered<TContext>(memberName); 66var dbContextOptionsDescriptor = new ServiceDescriptor( 97var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>));
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (5)
EnrichNpgsqlTests.cs (5)
127var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 166var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 172var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 210var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 263var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
Aspire.OpenAI (1)
AspireOpenAIExtensions.cs (1)
45/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.Oracle.EntityFrameworkCore (5)
src\Components\Common\EntityFrameworkUtils.cs (5)
34public static ServiceDescriptor CheckDbContextRegistered<TContext>(this IHostApplicationBuilder builder, [CallerMemberName] string memberName = "") 41var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>)); 57var oldDbContextOptionsDescriptor = builder.CheckDbContextRegistered<TContext>(memberName); 66var dbContextOptionsDescriptor = new ServiceDescriptor( 97var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>));
Aspire.Oracle.EntityFrameworkCore.Tests (5)
EnrichOracleDatabaseTests.cs (5)
124var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 162var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 168var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 205var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 255var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
Aspire.Pomelo.EntityFrameworkCore.MySql (5)
src\Components\Common\EntityFrameworkUtils.cs (5)
34public static ServiceDescriptor CheckDbContextRegistered<TContext>(this IHostApplicationBuilder builder, [CallerMemberName] string memberName = "") 41var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>)); 57var oldDbContextOptionsDescriptor = builder.CheckDbContextRegistered<TContext>(memberName); 66var dbContextOptionsDescriptor = new ServiceDescriptor( 97var oldDbContextOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TContext>));
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (5)
EnrichMySqlTests.cs (5)
137var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 175var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 181var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 218var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 268var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>));
Aspire.RabbitMQ.Client (1)
AspireRabbitMQExtensions.cs (1)
50/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.StackExchange.Redis (1)
AspireRedisExtensions.cs (1)
46/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.StackExchange.Redis.DistributedCaching (1)
AspireRedisDistributedCacheExtensions.cs (1)
44/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
Aspire.StackExchange.Redis.OutputCaching (1)
AspireRedisOutputCacheExtensions.cs (1)
43/// <param name="name">The name of the component, which is used as the <see cref="ServiceDescriptor.ServiceKey"/> of the service and also to retrieve the connection string from the ConnectionStrings configuration section.</param>
IntegrationTestsWebsite (1)
Startup.cs (1)
25services.TryAddEnumerable(ServiceDescriptor.Singleton<IServiceMethodProvider<DynamicService>, DynamicServiceModelProvider>());
Microsoft.AspNetCore (7)
BootstrapHostBuilder.cs (4)
24foreach (var descriptor in _builder.Services) 85public ServiceDescriptor RunDefaultCallbacks() 104ServiceDescriptor? genericWebHostServiceDescriptor = null; 108var descriptor = _builder.Services[i];
WebApplicationBuilder.cs (3)
30private readonly ServiceDescriptor _genericWebHostServiceDescriptor; 202private ServiceDescriptor InitializeHosting(BootstrapHostBuilder bootstrapHostBuilder) 206var genericWebHostServiceDescriptor = bootstrapHostBuilder.RunDefaultCallbacks();
Microsoft.AspNetCore.Antiforgery (1)
AntiforgeryServiceCollectionExtensions.cs (1)
29ServiceDescriptor.Transient<IConfigureOptions<AntiforgeryOptions>, AntiforgeryOptionsSetup>());
Microsoft.AspNetCore.AsyncState.Tests (1)
AsyncStateHttpContextExtensionsTests.cs (1)
28var serviceDescriptor = services.First(x => x.ServiceType == typeof(IHttpContextAccessor));
Microsoft.AspNetCore.Authentication (2)
AuthenticationBuilder.cs (2)
52Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<TOptions>, PostConfigureAuthenticationSchemeOptions<TOptions>>()); 97Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<TOptions>, EnsureSignInScheme<TOptions>>());
Microsoft.AspNetCore.Authentication.BearerToken (2)
BearerTokenExtensions.cs (2)
68builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JsonOptions>, BearerTokenConfigureJsonOptions>()); 69builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<BearerTokenOptions>, BearerTokenConfigureOptions>());
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieExtensions.cs (1)
79builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<CookieAuthenticationOptions>, PostConfigureCookieAuthenticationOptions>());
Microsoft.AspNetCore.Authentication.JwtBearer (2)
JwtBearerExtensions.cs (2)
77builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JwtBearerOptions>, JwtBearerConfigureOptions>()); 78builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<JwtBearerOptions>, JwtBearerPostConfigureOptions>());
Microsoft.AspNetCore.Authentication.Negotiate (2)
NegotiateExtensions.cs (2)
71builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<NegotiateOptions>, PostConfigureNegotiateOptions>()); 72builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IStartupFilter>(new NegotiateOptionsValidationStartupFilter(authenticationScheme)));
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthExtensions.cs (1)
62builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<TOptions>, OAuthPostConfigureOptions<TOptions, THandler>>());
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
OpenIdConnectExtensions.cs (2)
71builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<OpenIdConnectOptions>, OpenIdConnectConfigureOptions>()); 72builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<OpenIdConnectOptions>, OpenIdConnectPostConfigureOptions>());
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterExtensions.cs (1)
69builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<TwitterOptions>, TwitterPostConfigureOptions>());
Microsoft.AspNetCore.Authentication.WsFederation (1)
WsFederationExtensions.cs (1)
53builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<WsFederationOptions>, WsFederationPostConfigureOptions>());
Microsoft.AspNetCore.Authorization (6)
AuthorizationServiceCollectionExtensions.cs (6)
30services.TryAdd(ServiceDescriptor.Transient<IAuthorizationService, DefaultAuthorizationService>()); 31services.TryAdd(ServiceDescriptor.Transient<IAuthorizationPolicyProvider, DefaultAuthorizationPolicyProvider>()); 32services.TryAdd(ServiceDescriptor.Transient<IAuthorizationHandlerProvider, DefaultAuthorizationHandlerProvider>()); 33services.TryAdd(ServiceDescriptor.Transient<IAuthorizationEvaluator, DefaultAuthorizationEvaluator>()); 34services.TryAdd(ServiceDescriptor.Transient<IAuthorizationHandlerContextFactory, DefaultAuthorizationHandlerContextFactory>()); 35services.TryAddEnumerable(ServiceDescriptor.Transient<IAuthorizationHandler, PassThroughAuthorizationHandler>());
Microsoft.AspNetCore.Components (4)
CascadingValueServiceCollectionExtensions.cs (3)
68ServiceDescriptor.Scoped<ICascadingValueSupplier, CascadingValueSource<TValue>>( 86ServiceDescriptor.Scoped<ICascadingValueSupplier, CascadingValueSource<TValue>>( 107ServiceDescriptor.Scoped<ICascadingValueSupplier, CascadingValueSource<TValue>>(sourceFactory));
SupplyParameterFromQueryProviderServiceCollectionExtensions.cs (1)
22services.TryAddEnumerable(ServiceDescriptor.Scoped<ICascadingValueSupplier, SupplyParameterFromQueryValueProvider>());
Microsoft.AspNetCore.Components.Endpoints (1)
DependencyInjection\RazorComponentsServiceCollectionExtensions.cs (1)
68ServiceDescriptor.Singleton<IPostConfigureOptions<RazorComponentsServiceOptions>, DefaultRazorComponentsServiceOptionsConfiguration>());
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
HotReloadServiceTests.cs (1)
220services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(RenderModeEndpointProvider), type));
RazorComponentEndpointDataSourceTest.cs (1)
223services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(RenderModeEndpointProvider), type));
RazorComponentsServiceCollectionExtensionsTest.cs (2)
27foreach (var service in services) 56foreach (var service in services)
Microsoft.AspNetCore.Components.Server (4)
DependencyInjection\ComponentServiceCollectionExtensions.cs (3)
58services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, BlazorPackHubProtocol>()); 87services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<CircuitOptions>, CircuitOptionsJSInteropDetailedErrorsConfiguration>()); 88services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<CircuitOptions>, CircuitOptionsJavaScriptInitializersConfiguration>());
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
38builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<RenderModeEndpointProvider, CircuitEndpointProvider>());
Microsoft.AspNetCore.Components.Web (1)
Forms\Mapping\SupplyParameterFromFormServiceCollectionExtensions.cs (1)
21serviceCollection.TryAddEnumerable(ServiceDescriptor.Scoped<ICascadingValueSupplier, SupplyParameterFromFormValueProvider>(services =>
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
WebAssemblyRazorComponentsBuilderExtensions.cs (2)
26builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<RenderModeEndpointProvider, WebAssemblyEndpointProvider>()); 41builder.Services.TryAddEnumerable(ServiceDescriptor.Scoped<IHostEnvironmentAuthenticationStateProvider, AuthenticationStateSerializer>());
Microsoft.AspNetCore.Cors (2)
CorsServiceCollectionExtensions.cs (2)
25services.TryAdd(ServiceDescriptor.Transient<ICorsService, CorsService>()); 26services.TryAdd(ServiceDescriptor.Transient<ICorsPolicyProvider, DefaultCorsPolicyProvider>());
Microsoft.AspNetCore.DataProtection (5)
DataProtectionBuilderExtensions.cs (1)
521builder.Services.Replace(ServiceDescriptor.Singleton<IDataProtectionProvider, EphemeralDataProtectionProvider>());
DataProtectionServiceCollectionExtensions.cs (4)
69ServiceDescriptor.Singleton<IConfigureOptions<KeyManagementOptions>, KeyManagementOptionsSetup>()); 71ServiceDescriptor.Singleton<IPostConfigureOptions<KeyManagementOptions>, KeyManagementOptionsPostSetup>()); 73ServiceDescriptor.Transient<IConfigureOptions<DataProtectionOptions>, DataProtectionOptionsSetup>()); 77services.TryAddEnumerable(ServiceDescriptor.Singleton<IHostedService, DataProtectionHostedService>());
Microsoft.AspNetCore.DataProtection.Tests (4)
HostingTests.cs (3)
33.Replace(ServiceDescriptor.Singleton(mockKeyRing.Object)) 59.Replace(ServiceDescriptor.Singleton(mockKeyRing.Object)) 88.Replace(ServiceDescriptor.Singleton(mockKeyRing.Object))
ServiceCollectionTests.cs (1)
59foreach (var descriptor in serviceCollection)
Microsoft.AspNetCore.Diagnostics.Middleware (2)
Latency\RequestLatencyTelemetryServiceCollectionExtensions.cs (1)
73services.TryAddEnumerable(ServiceDescriptor.Singleton<IStartupFilter, CapturePipelineEntryStartupFilter>());
Logging\HttpLoggingServiceCollectionExtensions.cs (1)
40services.TryAddEnumerable(ServiceDescriptor.Singleton<IHttpLoggingInterceptor, HttpLoggingRedactionInterceptor>());
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
GrpcJsonTranscodingServiceExtensions.cs (2)
28builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(IServiceMethodProvider<>), typeof(JsonTranscodingServiceMethodProvider<>))); 29builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<GrpcJsonTranscodingOptions>, GrpcJsonTranscodingOptionsSetup>());
Microsoft.AspNetCore.Grpc.Swagger (2)
GrpcSwaggerServiceExtensions.cs (2)
33services.TryAddEnumerable(ServiceDescriptor.Transient<IApiDescriptionProvider, GrpcJsonTranscodingDescriptionProvider>()); 48services.Replace(ServiceDescriptor.Transient<ISerializerDataContractResolver>(s =>
Microsoft.AspNetCore.Hosting (5)
Internal\ServiceCollectionExtensions.cs (1)
13foreach (var service in serviceCollection)
WebHostBuilder.cs (3)
355services.Replace(ServiceDescriptor.Singleton(typeof(DiagnosticListener), listener!)); 356services.Replace(ServiceDescriptor.Singleton(typeof(DiagnosticSource), listener!)); 359services.Replace(ServiceDescriptor.Singleton(typeof(ActivitySource), activitySource!));
WebHostBuilderExtensions.cs (1)
205services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IServiceCollection>>(new DefaultServiceProviderFactory(options)));
Microsoft.AspNetCore.Hosting.Tests (4)
WebHostBuilderTests.cs (3)
1647internal ServiceDescriptor ServiceADescriptor { get; set; } 1684var heDescriptor = services.SingleOrDefault(s => s.ServiceType == typeof(IHostingEnvironment)); 1688var wheDescriptor = services.SingleOrDefault(s => s.ServiceType == typeof(IWebHostEnvironment));
WebHostTests.AsyncDisposable.cs (1)
17services.Add(ServiceDescriptor.Singleton<IServiceProviderFactory<IServiceCollection>>(providerFactory)
Microsoft.AspNetCore.Http.Connections (1)
ConnectionsDependencyInjectionExtensions.cs (1)
25services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<ConnectionOptions>, ConnectionOptionsSetup>());
Microsoft.AspNetCore.Http.Extensions (2)
ProblemDetailsServiceCollectionExtensions.cs (2)
42services.TryAddEnumerable(ServiceDescriptor.Singleton<IProblemDetailsWriter, DefaultProblemDetailsWriter>()); 44services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JsonOptions>, ProblemDetailsJsonOptionsSetup>());
Microsoft.AspNetCore.Http.Extensions.Tests (2)
ProblemDetailsServiceCollectionExtensionsTest.cs (2)
56collection.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(IProblemDetailsWriter), mockWriter)); 81var service = Assert.Single(collection, (sd) => sd.ServiceType == typeof(IProblemDetailsService));
Microsoft.AspNetCore.Http.Tests (1)
HttpServiceCollectionExtensionsTests.cs (1)
20var descriptor = services[0];
Microsoft.AspNetCore.HttpLogging (1)
HttpLoggingServicesExtensions.cs (1)
54services.TryAddEnumerable(ServiceDescriptor.Singleton<IHttpLoggingInterceptor, T>());
Microsoft.AspNetCore.Identity (3)
IdentityBuilderExtensions.cs (2)
46builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<SecurityStampValidatorOptions>, PostConfigureSecurityStampValidatorOptions>()); 102builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JsonOptions>, IdentityEndpointsJsonOptionsSetup>());
IdentityServiceCollectionExtensions.cs (1)
101services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<SecurityStampValidatorOptions>, PostConfigureSecurityStampValidatorOptions>());
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisServiceCollectionExtensions.cs (1)
27services.TryAddEnumerable(ServiceDescriptor.Transient<IStartupFilter, AnalysisStartupFilter>());
Microsoft.AspNetCore.Mvc (2)
MvcServiceCollectionExtensions.cs (2)
146ServiceDescriptor.Singleton<IActionDescriptorChangeProvider, HotReloadService>()); 317ServiceDescriptor.Singleton<IActionDescriptorChangeProvider, HotReloadService>());
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
DependencyInjection\EndpointMethodInfoApiExplorerServiceCollectionExtensions.cs (1)
31ServiceDescriptor.Transient<IApiDescriptionProvider, EndpointMetadataApiDescriptionProvider>());
DependencyInjection\MvcApiExplorerMvcCoreBuilderExtensions.cs (1)
40ServiceDescriptor.Transient<IApiDescriptionProvider, DefaultApiDescriptionProvider>());
Microsoft.AspNetCore.Mvc.Core (20)
DependencyInjection\MvcCoreMvcBuilderExtensions.cs (1)
132builder.Services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>());
DependencyInjection\MvcCoreMvcCoreBuilderExtensions.cs (2)
131ServiceDescriptor.Transient<IApplicationModelProvider, AuthorizationApplicationModelProvider>()); 149builder.Services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>());
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (17)
135ServiceDescriptor.Transient<IConfigureOptions<MvcOptions>, MvcCoreMvcOptionsSetup>()); 137ServiceDescriptor.Transient<IPostConfigureOptions<MvcOptions>, MvcCoreMvcOptionsSetup>()); 139ServiceDescriptor.Transient<IConfigureOptions<ApiBehaviorOptions>, ApiBehaviorOptionsSetup>()); 141ServiceDescriptor.Transient<IConfigureOptions<RouteOptions>, MvcCoreRouteOptionsSetup>()); 149ServiceDescriptor.Transient<IApplicationModelProvider, DefaultApplicationModelProvider>()); 151ServiceDescriptor.Transient<IApplicationModelProvider, ApiBehaviorApplicationModelProvider>()); 153ServiceDescriptor.Transient<IActionDescriptorProvider, ControllerActionDescriptorProvider>()); 164services.TryAddEnumerable(ServiceDescriptor.Transient<IActionConstraintProvider, DefaultActionConstraintProvider>()); 167services.TryAddEnumerable(ServiceDescriptor.Singleton<MatcherPolicy, ActionConstraintMatcherPolicy>()); 181ServiceDescriptor.Transient<IControllerPropertyActivator, DefaultControllerPropertyActivator>()); 189ServiceDescriptor.Transient<IActionInvokerProvider, ControllerActionInvokerProvider>()); 194ServiceDescriptor.Singleton<IFilterProvider, DefaultFilterProvider>()); 209services.TryAdd(ServiceDescriptor.Transient<ICompositeMetadataDetailsProvider>(s => 263services.TryAddEnumerable(ServiceDescriptor.Singleton<MatcherPolicy, DynamicControllerEndpointMatcherPolicy>()); 264services.TryAddEnumerable(ServiceDescriptor.Singleton<IRequestDelegateFactory, ControllerRequestDelegateFactory>()); 273services.TryAddEnumerable(ServiceDescriptor.Singleton<IStartupFilter, MiddlewareFilterBuilderStartupFilter>()); 277services.TryAddEnumerable(ServiceDescriptor.Singleton<IProblemDetailsWriter, DefaultApiProblemDetailsWriter>());
Microsoft.AspNetCore.Mvc.Core.Test (6)
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (3)
40services.Add(ServiceDescriptor.Transient(serviceType.Key, mockType)); 68services.Add(ServiceDescriptor.Transient(serviceType, mockType)); 93foreach (var service in services)
Routing\ControllerLinkGeneratorExtensionsTest.cs (1)
220services.TryAddEnumerable(ServiceDescriptor.Singleton<EndpointDataSource>(new DefaultEndpointDataSource(endpoints)));
Routing\EndpointRoutingUrlHelperTest.cs (1)
287ServiceDescriptor.Singleton<EndpointDataSource>(new DefaultEndpointDataSource(endpoints)));
Routing\PageLinkGeneratorExtensionsTest.cs (1)
190services.TryAddEnumerable(ServiceDescriptor.Singleton<EndpointDataSource>(new DefaultEndpointDataSource(endpoints)));
Microsoft.AspNetCore.Mvc.Cors (1)
DependencyInjection\MvcCorsMvcCoreBuilderExtensions.cs (1)
71ServiceDescriptor.Transient<IApplicationModelProvider, CorsApplicationModelProvider>());
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
DataAnnotationsLocalizationServices.cs (1)
25ServiceDescriptor.Transient
DependencyInjection\MvcDataAnnotationsMvcCoreBuilderExtensions.cs (1)
62ServiceDescriptor.Transient<IConfigureOptions<MvcOptions>, MvcDataAnnotationsMvcOptionsSetup>());
Microsoft.AspNetCore.Mvc.Formatters.Xml (4)
DependencyInjection\MvcXmlMvcBuilderExtensions.cs (2)
97ServiceDescriptor.Transient<IConfigureOptions<MvcOptions>, XmlDataContractSerializerMvcOptionsSetup>()); 104ServiceDescriptor.Transient<IConfigureOptions<MvcOptions>, XmlSerializerMvcOptionsSetup>());
DependencyInjection\MvcXmlMvcCoreBuilderExtensions.cs (2)
98ServiceDescriptor.Transient<IConfigureOptions<MvcOptions>, XmlDataContractSerializerMvcOptionsSetup>()); 105ServiceDescriptor.Transient<IConfigureOptions<MvcOptions>, XmlSerializerMvcOptionsSetup>());
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
Infrastructure\MvcWebApplicationBuilderExtensions.cs (1)
34services.TryAddEnumerable(ServiceDescriptor.Singleton<IStartupFilter, CultureReplacerStartupFilter>());
TempDataInCookiesTest.cs (1)
44foreach (var serializer in tempDataSerializers)
Microsoft.AspNetCore.Mvc.Localization (3)
MvcLocalizationServices.cs (3)
41services.TryAdd(ServiceDescriptor.Singleton<IHtmlLocalizerFactory, HtmlLocalizerFactory>()); 42services.TryAdd(ServiceDescriptor.Transient(typeof(IHtmlLocalizer<>), typeof(HtmlLocalizer<>))); 43services.TryAdd(ServiceDescriptor.Transient<IViewLocalizer, ViewLocalizer>());
Microsoft.AspNetCore.Mvc.Localization.Test (7)
MvcLocalizationMvcBuilderExtensionsTest.cs (2)
46var service = services.FirstOrDefault( 125private ServiceDescriptor GetService(IServiceCollection services, Type serviceType)
MvcLocalizationMvcCoreBuilderExtensionsTest.cs (2)
46var service = services.FirstOrDefault( 125private ServiceDescriptor GetService(IServiceCollection services, Type serviceType)
MvcLocalizationServiceCollectionExtensionsTest.cs (3)
38collection.Add(ServiceDescriptor.Singleton(typeof(IHtmlLocalizerFactory), typeof(TestHtmlLocalizerFactory))); 39collection.Add(ServiceDescriptor.Transient(typeof(IHtmlLocalizer<>), typeof(TestHtmlLocalizer<>))); 40collection.Add(ServiceDescriptor.Transient(typeof(IViewLocalizer), typeof(TestViewLocalizer)));
Microsoft.AspNetCore.Mvc.NewtonsoftJson (5)
DependencyInjection\NewtonsoftJsonMvcCoreBuilderExtensions.cs (5)
60ServiceDescriptor.Transient<IConfigureOptions<MvcOptions>, NewtonsoftJsonMvcOptionsSetup>()); 62ServiceDescriptor.Transient<IApiDescriptionProvider, JsonPatchOperationsArrayProvider>()); 64var jsonResultExecutor = services.FirstOrDefault(f => 75var tempDataSerializer = services.FirstOrDefault(f => 89var jsonHelper = services.FirstOrDefault(
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (3)
DependencyInjection\NewtonsoftJsonMvcCoreBuilderExtensionsTest.cs (3)
44var jsonHelper = Assert.Single(services, d => d.ServiceType == typeof(IJsonHelper)); 59var tempDataSerializer = Assert.Single(services, d => d.ServiceType == typeof(TempDataSerializer)); 74var jsonResultExecutor = Assert.Single(services, d => d.ServiceType == typeof(IActionResultExecutor<JsonResult>));
Microsoft.AspNetCore.Mvc.Razor (3)
DependencyInjection\MvcRazorMvcCoreBuilderExtensions.cs (2)
126ServiceDescriptor.Transient<IConfigureOptions<MvcViewOptions>, MvcRazorMvcViewOptionsSetup>()); 129ServiceDescriptor.Transient<IConfigureOptions<RazorViewEngineOptions>, RazorViewEngineOptionsSetup>());
DependencyInjection\TagHelpersAsServices.cs (1)
27services.Replace(ServiceDescriptor.Transient<ITagHelperActivator, ServiceBasedTagHelperActivator>());
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (7)
DependencyInjection\RazorRuntimeCompilationMvcCoreBuilderExtensions.cs (7)
58ServiceDescriptor.Transient<IConfigureOptions<MvcRazorRuntimeCompilationOptions>, MvcRazorRuntimeCompilationOptionsSetup>()); 60var compilerProvider = services.FirstOrDefault(f => 73var actionDescriptorProvider = services.FirstOrDefault(f => 86ServiceDescriptor.Singleton<IActionDescriptorProvider, PageActionDescriptorProvider>()); 87services.TryAddEnumerable(ServiceDescriptor.Singleton<MatcherPolicy, PageLoaderMatcherPolicy>()); 120ServiceDescriptor.Singleton<IPageRouteModelProvider, RazorProjectPageRouteModelProvider>()); 123ServiceDescriptor.Singleton<IActionDescriptorChangeProvider, PageActionDescriptorChangeProvider>());
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
DependencyInjection\RazorRuntimeCompilationMvcCoreBuilderExtensionsTest.cs (2)
25var serviceDescriptor = Assert.Single(services, service => service.ServiceType == typeof(IViewCompilerProvider)); 40var serviceDescriptor = Assert.Single(services, service => service.ServiceType == typeof(IActionDescriptorProvider));
Microsoft.AspNetCore.Mvc.Razor.Test (8)
DependencyInjection\MvcRazorMvcBuilderExtensionsTest.cs (4)
28var activatorDescriptor = Assert.Single(services.ToList(), d => d.ServiceType == typeof(ITagHelperActivator)); 54var tagHelperOne = Assert.Single(collection, t => t.ServiceType == typeof(TestTagHelperOne)); 58var tagHelperTwo = Assert.Single(collection, t => t.ServiceType == typeof(TestTagHelperTwo)); 62var activator = Assert.Single(collection, t => t.ServiceType == typeof(ITagHelperActivator));
DependencyInjection\MvcRazorMvcCoreBuilderExtensionsTest.cs (4)
68var activatorDescriptor = Assert.Single(services.ToList(), d => d.ServiceType == typeof(ITagHelperActivator)); 94var tagHelperOne = Assert.Single(collection, t => t.ServiceType == typeof(TestTagHelperOne)); 98var tagHelperTwo = Assert.Single(collection, t => t.ServiceType == typeof(TestTagHelperTwo)); 102var activator = Assert.Single(collection, t => t.ServiceType == typeof(ITagHelperActivator));
Microsoft.AspNetCore.Mvc.RazorPages (15)
DependencyInjection\MvcRazorPagesMvcCoreBuilderExtensions.cs (15)
83ServiceDescriptor.Transient<IConfigureOptions<RazorViewEngineOptions>, RazorPagesRazorViewEngineOptionsSetup>()); 86ServiceDescriptor.Transient<IConfigureOptions<RazorPagesOptions>, RazorPagesOptionsSetup>()); 89services.TryAddEnumerable(ServiceDescriptor.Singleton<MatcherPolicy, DynamicPageEndpointMatcherPolicy>()); 94var actionDescriptorProvider = services.FirstOrDefault(f => 105ServiceDescriptor.Singleton<IActionDescriptorProvider, CompiledPageActionDescriptorProvider>()); 108ServiceDescriptor.Singleton<IPageRouteModelProvider, CompiledPageRouteModelProvider>()); 110services.TryAddEnumerable(ServiceDescriptor.Singleton<MatcherPolicy, DynamicPageEndpointMatcherPolicy>()); 113ServiceDescriptor.Singleton<IPageApplicationModelProvider, DefaultPageApplicationModelProvider>()); 115ServiceDescriptor.Singleton<IPageApplicationModelProvider, AutoValidateAntiforgeryPageApplicationModelProvider>()); 117ServiceDescriptor.Singleton<IPageApplicationModelProvider, AuthorizationPageApplicationModelProvider>()); 119ServiceDescriptor.Singleton<IPageApplicationModelProvider, TempDataFilterPageApplicationModelProvider>()); 121ServiceDescriptor.Singleton<IPageApplicationModelProvider, ViewDataAttributePageApplicationModelProvider>()); 123ServiceDescriptor.Singleton<IPageApplicationModelProvider, ResponseCacheFilterApplicationModelProvider>()); 128ServiceDescriptor.Singleton<IActionInvokerProvider, PageActionInvokerProvider>()); 130ServiceDescriptor.Singleton<IRequestDelegateFactory, PageRequestDelegateFactory>());
Microsoft.AspNetCore.Mvc.Test (9)
MvcServiceCollectionExtensionsTest.cs (9)
65services.Add(ServiceDescriptor.Transient(serviceType.Key, mockType)); 149services.Add(ServiceDescriptor.Transient(serviceType, mockType)); 264foreach (var service in services) 310var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager)); 338var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager)); 364var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager)); 388var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager)); 436var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 648foreach ( var service in matches )
Microsoft.AspNetCore.Mvc.ViewFeatures (13)
DependencyInjection\MvcViewFeaturesMvcBuilderExtensions.cs (5)
53builder.Services.Replace(ServiceDescriptor.Singleton<IViewComponentActivator, ServiceBasedViewComponentActivator>()); 71var descriptor = ServiceDescriptor.Singleton(typeof(ITempDataProvider), typeof(SessionStateTempDataProvider)); 90var descriptor = ServiceDescriptor.Singleton(typeof(ITempDataProvider), typeof(CookieTempDataProvider));
DependencyInjection\MvcViewFeaturesMvcCoreBuilderExtensions.cs (8)
56var descriptor = ServiceDescriptor.Singleton(typeof(ITempDataProvider), typeof(CookieTempDataProvider)); 137ServiceDescriptor.Transient<IConfigureOptions<MvcViewOptions>, MvcViewOptionsSetup>()); 139ServiceDescriptor.Transient<IConfigureOptions<MvcOptions>, TempDataMvcOptionsSetup>()); 150ServiceDescriptor 188ServiceDescriptor.Transient<IApplicationModelProvider, TempDataApplicationModelProvider>()); 190ServiceDescriptor.Transient<IApplicationModelProvider, ViewDataAttributeApplicationModelProvider>()); 204ServiceDescriptor.Transient<IApplicationModelProvider, AntiforgeryApplicationModelProvider>());
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (13)
DependencyInjection\MvcViewFeaturesMvcBuilderExtensionsTest.cs (4)
45var descriptor = Assert.Single(builder.Services, item => item.ServiceType == typeof(ITempDataProvider)); 74var descriptor = Assert.Single(builder.Services, item => item.ServiceType == typeof(ITempDataProvider)); 104var descriptor = Assert.Single(builder.Services, item => item.ServiceType == typeof(ITempDataProvider)); 119var descriptor = Assert.Single(builder.Services, item => item.ServiceType == typeof(ITempDataProvider));
DependencyInjection\MvcViewFeaturesMvcCoreBuilderExtensionsTest.cs (9)
23var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 38var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 69var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 101var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 117var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 133var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 149var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 165var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 181var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider));
Microsoft.AspNetCore.OpenApi (1)
Extensions\OpenApiServiceCollectionExtensions.cs (1)
114services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JsonOptions>, OpenApiSchemaJsonOptions>());
Microsoft.AspNetCore.Routing (8)
DependencyInjection\RoutingServiceCollectionExtensions.cs (8)
31services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<RouteOptions>, RegexInlineRouteConstraintSetup>()); 59services.TryAdd(ServiceDescriptor.Transient<TreeRouteBuilder>(s => 71services.TryAddEnumerable(ServiceDescriptor.Transient<IConfigureOptions<RouteOptions>, ConfigureRouteOptions>( 105services.TryAddEnumerable(ServiceDescriptor.Singleton<MatcherPolicy, HttpMethodMatcherPolicy>()); 106services.TryAddEnumerable(ServiceDescriptor.Singleton<MatcherPolicy, HostMatcherPolicy>()); 107services.TryAddEnumerable(ServiceDescriptor.Singleton<MatcherPolicy, AcceptsMatcherPolicy>()); 108services.TryAddEnumerable(ServiceDescriptor.Singleton<MatcherPolicy, ContentEncodingNegotiationMatcherPolicy>()); 118services.TryAddEnumerable(ServiceDescriptor.Transient<IConfigureOptions<RouteHandlerOptions>, ConfigureRouteHandlerOptions>());
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
EndpointRoutingBenchmarkBase.cs (1)
35ServiceDescriptor.Singleton<EndpointDataSource>(new DefaultEndpointDataSource(Endpoints)));
Microsoft.AspNetCore.Server.Kestrel (2)
WebHostBuilderKestrelExtensions.cs (2)
134services.TryAddEnumerable(ServiceDescriptor.Transient<IConfigureOptions<KestrelServerOptions>, KestrelServerOptionsSetup>()); 170services.TryAddEnumerable(ServiceDescriptor.Transient<IConfigureOptions<KestrelServerOptions>, KestrelServerOptionsSetup>());
Microsoft.AspNetCore.SignalR (1)
SignalRDependencyInjectionExtensions.cs (1)
46services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<HubOptions>, HubOptionsSetup>());
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
VersionStartup.cs (1)
24services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol>(new VersionedJsonHubProtocol(1000)));
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
HubConnectionReceiveBenchmark.cs (1)
72hubConnectionBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(IHubProtocol), hubProtocol));
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
JsonProtocolDependencyInjectionExtensions.cs (1)
38builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, JsonHubProtocol>());
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
MessagePackProtocolDependencyInjectionExtensions.cs (1)
41builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, MessagePackHubProtocol>());
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
NewtonsoftJsonProtocolDependencyInjectionExtensions.cs (1)
41builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, NewtonsoftJsonHubProtocol>());
Microsoft.AspNetCore.SignalR.Tests (2)
AddSignalRTests.cs (2)
178serviceCollection.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, CustomHubProtocol>()); 179serviceCollection.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, MessagePackHubProtocol>());
Microsoft.AspNetCore.SpaProxy (1)
SpaHostingStartup.cs (1)
29services.TryAddEnumerable(ServiceDescriptor.Singleton<IStartupFilter, SpaProxyStartupFilter>());
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (2)
1821Assert.Throws<InvalidOperationException>(() => builder.Services.Remove(ServiceDescriptor.Singleton(new Service()))); 1822Assert.Throws<InvalidOperationException>(() => builder.Services[0] = ServiceDescriptor.Singleton(new Service()));
Microsoft.Authentication.WebAssembly.Msal (1)
MsalWebAssemblyServiceCollectionExtensions.cs (1)
61services.TryAddEnumerable(ServiceDescriptor.Scoped<IPostConfigureOptions<RemoteAuthenticationOptions<MsalProviderOptions>>, MsalDefaultOptionsConfiguration>());
Microsoft.DotNet.Internal.DependencyInjection.Testing (2)
DependencyInjectionValidation.cs (2)
50foreach (ServiceDescriptor service in services) 145ServiceDescriptor parameterService = services.FirstOrDefault(s => IsMatchingServiceRegistration(s.ServiceType, p.ParameterType));
Microsoft.Extensions.AsyncState.Tests (1)
AsyncContextServiceCollectionExtensionsTests.cs (1)
29var serviceDescriptor = services.First(x => x.ServiceType == typeof(IAsyncContext<>));
Microsoft.Extensions.Caching.Memory (2)
MemoryCacheServiceCollectionExtensions.cs (2)
27services.TryAdd(ServiceDescriptor.Singleton<IMemoryCache, MemoryCache>()); 71services.TryAdd(ServiceDescriptor.Singleton<IDistributedCache, MemoryDistributedCache>());
Microsoft.Extensions.Caching.SqlServer (1)
SqlServerCachingServicesExtensions.cs (1)
37services.Add(ServiceDescriptor.Singleton<IDistributedCache, SqlServerCache>());
Microsoft.Extensions.Caching.SqlServer.Tests (2)
SqlServerCacheServicesExtensionsTest.cs (2)
24var serviceDescriptor = Assert.Single(services); 48var distributedCache = services.FirstOrDefault(desc => desc.ServiceType == typeof(IDistributedCache));
Microsoft.Extensions.Caching.StackExchangeRedis (1)
StackExchangeRedisCacheServiceCollectionExtensions.cs (1)
32services.Add(ServiceDescriptor.Singleton<IDistributedCache, RedisCacheImpl>());
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (3)
CacheServiceExtensionsTests.cs (3)
26var distributedCache = services.FirstOrDefault(desc => desc.ServiceType == typeof(IDistributedCache)); 45var distributedCache = services.FirstOrDefault(desc => desc.ServiceType == typeof(IDistributedCache)); 116var distributedCache = services.FirstOrDefault(desc => desc.ServiceType == typeof(IDistributedCache));
Microsoft.Extensions.Compliance.Redaction (4)
RedactionBuilder.cs (4)
29Services.TryAddEnumerable(ServiceDescriptor.Singleton<Redactor>(ErasingRedactor.Instance)); 30Services.TryAddEnumerable(ServiceDescriptor.Singleton<Redactor>(NullRedactor.Instance)); 41Services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(Redactor), redactorType)); 51Services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(Redactor), typeof(T)));
Microsoft.Extensions.DependencyInjection (34)
DependencyInjectionEventSource.cs (2)
183foreach (ServiceDescriptor descriptor in provider.CallSiteFactory.Descriptors) 239private static void AppendServiceDescriptor(StringBuilder builder, ServiceDescriptor descriptor)
ServiceLookup\CallSiteFactory.cs (17)
17private readonly ServiceDescriptor[] _descriptors; 24public CallSiteFactory(ICollection<ServiceDescriptor> descriptors) 27_descriptors = new ServiceDescriptor[descriptors.Count]; 33internal ServiceDescriptor[] Descriptors => _descriptors; 37foreach (ServiceDescriptor descriptor in _descriptors) 152internal int? GetSlot(ServiceDescriptor serviceDescriptor) 166internal ServiceCallSite? GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain) 295ServiceDescriptor descriptor = descriptors[i]; 370private ServiceCallSite? TryCreateExact(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot) 417private ServiceCallSite? TryCreateOpenGeneric(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot, bool throwOnConstraintViolation) 717private ServiceDescriptor? _item; 720private List<ServiceDescriptor>? _items; 722public ServiceDescriptor Last 750public ServiceDescriptor this[int index] 768public int GetSlot(ServiceDescriptor descriptor) 787public ServiceDescriptorCacheItem Add(ServiceDescriptor descriptor) 798newCacheItem._items = _items ?? new List<ServiceDescriptor>();
ServiceLookup\ServiceDescriptorExtensions.cs (7)
11public static bool HasImplementationInstance(this ServiceDescriptor serviceDescriptor) => GetImplementationInstance(serviceDescriptor) != null; 13public static bool HasImplementationFactory(this ServiceDescriptor serviceDescriptor) => GetImplementationFactory(serviceDescriptor) != null; 15public static bool HasImplementationType(this ServiceDescriptor serviceDescriptor) => GetImplementationType(serviceDescriptor) != null; 17public static object? GetImplementationInstance(this ServiceDescriptor serviceDescriptor) 24public static object? GetImplementationFactory(this ServiceDescriptor serviceDescriptor) 32public static Type? GetImplementationType(this ServiceDescriptor serviceDescriptor) 39public static bool TryGetImplementationType(this ServiceDescriptor serviceDescriptor, out Type? type)
ServiceLookup\ServiceIdentifier.cs (1)
26public static ServiceIdentifier FromDescriptor(ServiceDescriptor serviceDescriptor)
ServiceLookup\ServiceProviderEngineScope.cs (2)
255public List<ServiceDescriptor> ServiceDescriptors => new List<ServiceDescriptor>(_serviceProvider.RootProvider.CallSiteFactory.Descriptors);
ServiceProvider.cs (5)
52internal ServiceProvider(ICollection<ServiceDescriptor> serviceDescriptors, ServiceProviderOptions options) 76foreach (ServiceDescriptor serviceDescriptor in serviceDescriptors) 186private void ValidateService(ServiceDescriptor descriptor) 282public List<ServiceDescriptor> ServiceDescriptors => new List<ServiceDescriptor>(_serviceProvider.Root.RootProvider.CallSiteFactory.Descriptors);
Microsoft.Extensions.DependencyInjection.Abstractions (268)
Extensions\ServiceCollectionDescriptorExtensions.cs (55)
19/// <param name="descriptor">The <see cref="ServiceDescriptor"/> to add.</param> 23ServiceDescriptor descriptor) 33/// Adds a sequence of <see cref="ServiceDescriptor"/> to the <paramref name="collection"/>. 36/// <param name="descriptors">The <see cref="ServiceDescriptor"/>s to add.</param> 40IEnumerable<ServiceDescriptor> descriptors) 45foreach (ServiceDescriptor? descriptor in descriptors) 58/// <param name="descriptor">The <see cref="ServiceDescriptor"/> to add.</param> 61ServiceDescriptor descriptor) 85/// <param name="descriptors">The <see cref="ServiceDescriptor"/>s to add.</param> 88IEnumerable<ServiceDescriptor> descriptors) 93foreach (ServiceDescriptor? d in descriptors) 112var descriptor = ServiceDescriptor.Transient(service, service); 133var descriptor = ServiceDescriptor.Transient(service, implementationType); 154var descriptor = ServiceDescriptor.Transient(service, implementationFactory); 202services.TryAdd(ServiceDescriptor.Transient(implementationFactory)); 218var descriptor = ServiceDescriptor.Scoped(service, service); 239var descriptor = ServiceDescriptor.Scoped(service, implementationType); 260var descriptor = ServiceDescriptor.Scoped(service, implementationFactory); 308services.TryAdd(ServiceDescriptor.Scoped(implementationFactory)); 324var descriptor = ServiceDescriptor.Singleton(service, service); 345var descriptor = ServiceDescriptor.Singleton(service, implementationType); 366var descriptor = ServiceDescriptor.Singleton(service, implementationFactory); 415var descriptor = ServiceDescriptor.Singleton(serviceType: typeof(TService), implementationInstance: instance); 432services.TryAdd(ServiceDescriptor.Singleton(implementationFactory)); 436/// Adds a <see cref="ServiceDescriptor"/> if an existing descriptor with the same 437/// <see cref="ServiceDescriptor.ServiceType"/> and an implementation that does not already exist 441/// <param name="descriptor">The <see cref="ServiceDescriptor"/>.</param> 443/// Use <see cref="TryAddEnumerable(IServiceCollection, ServiceDescriptor)"/> when registering a service implementation of a 446/// <see cref="Add(IServiceCollection, ServiceDescriptor)"/> is not idempotent and can add 448/// <see cref="ServiceDescriptor"/> instances if called twice. Using 449/// <see cref="TryAddEnumerable(IServiceCollection, ServiceDescriptor)"/> will prevent registration 454ServiceDescriptor descriptor) 474ServiceDescriptor service = services[i]; 488/// Adds the specified <see cref="ServiceDescriptor"/>s if an existing descriptor with the same 489/// <see cref="ServiceDescriptor.ServiceType"/> and an implementation that does not already exist 493/// <param name="descriptors">The <see cref="ServiceDescriptor"/>s.</param> 495/// Use <see cref="TryAddEnumerable(IServiceCollection, ServiceDescriptor)"/> when registering a service 498/// <see cref="Add(IServiceCollection, ServiceDescriptor)"/> is not idempotent and can add 500/// <see cref="ServiceDescriptor"/> instances if called twice. Using 501/// <see cref="TryAddEnumerable(IServiceCollection, ServiceDescriptor)"/> will prevent registration 506IEnumerable<ServiceDescriptor> descriptors) 511foreach (ServiceDescriptor? d in descriptors) 522/// <param name="descriptor">The <see cref="ServiceDescriptor"/> to replace with.</param> 526ServiceDescriptor descriptor) 568ServiceDescriptor? descriptor = collection[i];
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (24)
27var descriptor = ServiceDescriptor.KeyedTransient(service, serviceKey, service); 50var descriptor = ServiceDescriptor.KeyedTransient(service, serviceKey, implementationType); 73var descriptor = ServiceDescriptor.KeyedTransient(service, serviceKey, implementationFactory); 125services.TryAdd(ServiceDescriptor.KeyedTransient(serviceKey, implementationFactory)); 143var descriptor = ServiceDescriptor.KeyedScoped(service, serviceKey, service); 166var descriptor = ServiceDescriptor.KeyedScoped(service, serviceKey, implementationType); 189var descriptor = ServiceDescriptor.KeyedScoped(service, serviceKey, implementationFactory); 241services.TryAdd(ServiceDescriptor.KeyedScoped(serviceKey, implementationFactory)); 259var descriptor = ServiceDescriptor.KeyedSingleton(service, serviceKey, service); 282var descriptor = ServiceDescriptor.KeyedSingleton(service, serviceKey, implementationType); 305var descriptor = ServiceDescriptor.KeyedSingleton(service, serviceKey, implementationFactory); 357var descriptor = ServiceDescriptor.KeyedSingleton(serviceType: typeof(TService), serviceKey, implementationInstance: instance); 376services.TryAdd(ServiceDescriptor.KeyedSingleton(serviceKey, implementationFactory)); 403ServiceDescriptor? descriptor = collection[i];
IKeyedServiceProvider.cs (1)
28/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
IServiceCollection.cs (1)
11public interface IServiceCollection : IList<ServiceDescriptor>
IServiceProviderIsKeyedService.cs (1)
19/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
ServiceCollection.cs (14)
18private readonly List<ServiceDescriptor> _descriptors = new List<ServiceDescriptor>(); 28public ServiceDescriptor this[int index] 49public bool Contains(ServiceDescriptor item) 55public void CopyTo(ServiceDescriptor[] array, int arrayIndex) 61public bool Remove(ServiceDescriptor item) 68public IEnumerator<ServiceDescriptor> GetEnumerator() 73void ICollection<ServiceDescriptor>.Add(ServiceDescriptor item) 85public int IndexOf(ServiceDescriptor item) 91public void Insert(int index, ServiceDescriptor item) 146public ServiceDescriptor[] Items 150ServiceDescriptor[] items = new ServiceDescriptor[_services.Count];
ServiceCollectionServiceExtensions.cs (3)
460var serviceDescriptor = new ServiceDescriptor(serviceType, implementationInstance); 491var descriptor = new ServiceDescriptor(serviceType, implementationType, lifetime); 502var descriptor = new ServiceDescriptor(serviceType, implementationFactory, lifetime);
ServiceCollectionServiceExtensions.Keyed.cs (26)
21/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 45/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 70/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 90/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 110/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 130/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 155/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 179/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 203/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 228/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 248/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 268/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 288/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 313/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 337/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 361/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 386/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 406/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 426/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 446/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 471/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 495/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 509var serviceDescriptor = new ServiceDescriptor(serviceType, serviceKey, implementationInstance); 520/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 543var descriptor = new ServiceDescriptor(serviceType, serviceKey, implementationType, lifetime); 555var descriptor = new ServiceDescriptor(serviceType, serviceKey, implementationFactory, lifetime);
ServiceDescriptor.cs (143)
17/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="implementationType"/>. 31/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="implementationType"/>. 34/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 51/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="instance"/> 64/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="instance"/> 68/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 83/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="factory"/>. 101/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="factory"/>. 104/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 332/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 338/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 339public static ServiceDescriptor Transient<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>() 347/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 353/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 354/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 355public static ServiceDescriptor KeyedTransient<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(object? serviceKey) 363/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 369/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 370public static ServiceDescriptor Transient( 381/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 386/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 388/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 389public static ServiceDescriptor KeyedTransient( 401/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 409/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 410public static ServiceDescriptor Transient<TService, TImplementation>( 421/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 428/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 430/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 431public static ServiceDescriptor KeyedTransient<TService, TImplementation>( 443/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 449/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 450public static ServiceDescriptor Transient<TService>(Func<IServiceProvider, TService> implementationFactory) 459/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 464/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 466/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 467public static ServiceDescriptor KeyedTransient<TService>(object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory) 476/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 482/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 483public static ServiceDescriptor Transient(Type service, Func<IServiceProvider, object> implementationFactory) 492/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 497/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 499/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 500public static ServiceDescriptor KeyedTransient(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory) 509/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 515/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 516public static ServiceDescriptor Scoped<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>() 524/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 530/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 531/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 532public static ServiceDescriptor KeyedScoped<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(object? serviceKey) 540/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 546/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 547public static ServiceDescriptor Scoped( 555/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 560/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 562/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 563public static ServiceDescriptor KeyedScoped( 572/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 580/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 581public static ServiceDescriptor Scoped<TService, TImplementation>( 592/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 599/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 601/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 602public static ServiceDescriptor KeyedScoped<TService, TImplementation>( 614/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 620/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 621public static ServiceDescriptor Scoped<TService>(Func<IServiceProvider, TService> implementationFactory) 630/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 635/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 637/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 638public static ServiceDescriptor KeyedScoped<TService>(object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory) 647/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 653/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 654public static ServiceDescriptor Scoped(Type service, Func<IServiceProvider, object> implementationFactory) 663/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 668/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 670/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 671public static ServiceDescriptor KeyedScoped(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory) 680/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 686/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 687public static ServiceDescriptor Singleton<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>() 695/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 701/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 702/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 703public static ServiceDescriptor KeyedSingleton<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 712/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 718/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 719public static ServiceDescriptor Singleton( 730/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 735/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 737/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 738public static ServiceDescriptor KeyedSingleton( 750/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 758/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 759public static ServiceDescriptor Singleton<TService, TImplementation>( 770/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 777/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 779/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 780public static ServiceDescriptor KeyedSingleton<TService, TImplementation>( 792/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 798/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 799public static ServiceDescriptor Singleton<TService>(Func<IServiceProvider, TService> implementationFactory) 808/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 813/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 815/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 816public static ServiceDescriptor KeyedSingleton<TService>( 827/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 833/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 834public static ServiceDescriptor Singleton( 845/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 850/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 852/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 853public static ServiceDescriptor KeyedSingleton( 865/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 871/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 872public static ServiceDescriptor Singleton<TService>(TService implementationInstance) 881/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 886/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 888/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 889public static ServiceDescriptor KeyedSingleton<TService>( 900/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 906/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 907public static ServiceDescriptor Singleton( 918/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 923/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 925/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 926public static ServiceDescriptor KeyedSingleton( 937private static ServiceDescriptor DescribeKeyed<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 951/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 958/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 959public static ServiceDescriptor Describe( 968/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 973/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 976/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 977public static ServiceDescriptor DescribeKeyed( 987/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 994/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 995public static ServiceDescriptor Describe(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime) 1001/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified 1006/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param> 1009/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns> 1010public static ServiceDescriptor DescribeKeyed(Type serviceType, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory, ServiceLifetime lifetime)
Microsoft.Extensions.DependencyInjection.AutoActivation (16)
AutoActivationExtensions.cs (8)
235services.TryAddAndActivate(ServiceDescriptor.Singleton(serviceType, serviceType)); 253services.TryAddAndActivate(ServiceDescriptor.Singleton(serviceType, implementationType)); 268services.TryAddAndActivate(ServiceDescriptor.Singleton(serviceType, implementationFactory)); 281services.TryAddAndActivate<TService>(ServiceDescriptor.Singleton<TService, TService>()); 296services.TryAddAndActivate<TService>(ServiceDescriptor.Singleton<TService, TImplementation>()); 311services.TryAddAndActivate<TService>(ServiceDescriptor.Singleton<TService>(implementationFactory)); 314private static void TryAddAndActivate<TService>(this IServiceCollection services, ServiceDescriptor descriptor) 326private static void TryAddAndActivate(this IServiceCollection services, ServiceDescriptor descriptor)
AutoActivationExtensions.Keyed.cs (8)
252services.TryAddAndActivateKeyed(ServiceDescriptor.KeyedSingleton(serviceType, serviceKey, serviceType)); 272services.TryAddAndActivateKeyed(ServiceDescriptor.KeyedSingleton(serviceType, serviceKey, implementationType)); 292services.TryAddAndActivateKeyed(ServiceDescriptor.KeyedSingleton(serviceType, serviceKey, implementationFactory)); 308services.TryAddAndActivateKeyed<TService>(ServiceDescriptor.KeyedSingleton<TService, TService>(serviceKey)); 326services.TryAddAndActivateKeyed<TService>(ServiceDescriptor.KeyedSingleton<TService, TImplementation>(serviceKey)); 345services.TryAddAndActivateKeyed<TService>(ServiceDescriptor.KeyedSingleton<TService>(serviceKey, implementationFactory)); 348private static void TryAddAndActivateKeyed<TService>(this IServiceCollection services, ServiceDescriptor descriptor) 360private static void TryAddAndActivateKeyed(this IServiceCollection services, ServiceDescriptor descriptor)
Microsoft.Extensions.Diagnostics.Abstractions (2)
Metrics\MetricsBuilderExtensions.Listeners.cs (2)
25builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IMetricsListener, T>()); 38builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton(listener));
Microsoft.Extensions.Diagnostics.ExceptionSummarization (1)
ExceptionSummarizationBuilder.cs (1)
22Services.TryAddEnumerable(ServiceDescriptor.Singleton<IExceptionSummaryProvider, T>());
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DependencyInjection\HealthCheckServiceCollectionExtensions.cs (1)
29services.TryAddEnumerable(ServiceDescriptor.Singleton<IHostedService, HealthCheckPublisherHostedService>());
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
ResourceMonitorBuilder.cs (2)
20services.TryAddEnumerable(ServiceDescriptor.Singleton<IHostedService, ResourceMonitorService>(static sp => sp.GetRequiredService<ResourceMonitorService>())); 35Services.TryAddEnumerable(ServiceDescriptor.Singleton<IResourceUtilizationPublisher, T>());
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (3)
Linux\AcceptanceTest.cs (3)
127.Replace(ServiceDescriptor.Singleton<ILinuxUtilizationParser, LinuxUtilizationParserCgroupV1>()) 175.Replace(ServiceDescriptor.Singleton<ILinuxUtilizationParser, LinuxUtilizationParserCgroupV2>()) 317.Replace(ServiceDescriptor.Singleton<ILinuxUtilizationParser, LinuxUtilizationParserCgroupV2>()))
Microsoft.Extensions.Diagnostics.Testing (2)
Logging\FakeLoggerBuilderExtensions.cs (2)
30builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, FakeLoggerProvider>()); 48builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, FakeLoggerProvider>());
Microsoft.Extensions.Hosting.Abstractions (2)
ServiceCollectionHostedServiceExtensions.cs (2)
25services.TryAddEnumerable(ServiceDescriptor.Singleton<IHostedService, THostedService>()); 40services.TryAddEnumerable(ServiceDescriptor.Singleton<IHostedService>(implementationFactory));
Microsoft.Extensions.Http (19)
DependencyInjection\DefaultHttpClientBuilderServiceCollection.cs (8)
25public void Add(ServiceDescriptor item) 59public ServiceDescriptor this[int index] 67public bool Contains(ServiceDescriptor item) => _services.Contains(item); 68public void CopyTo(ServiceDescriptor[] array, int arrayIndex) => _services.CopyTo(array, arrayIndex); 69public IEnumerator<ServiceDescriptor> GetEnumerator() => _services.GetEnumerator(); 70public int IndexOf(ServiceDescriptor item) => _services.IndexOf(item); 71public void Insert(int index, ServiceDescriptor item) => _services.Insert(index, item); 72public bool Remove(ServiceDescriptor item) => _services.Remove(item);
DependencyInjection\DefaultHttpClientConfigurationTracker.cs (1)
8public ServiceDescriptor? InsertDefaultsAfterDescriptor { get; set; }
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (4)
47services.TryAdd(ServiceDescriptor.Transient(typeof(ITypedHttpClientFactory<>), typeof(DefaultTypedHttpClientFactory<>))); 48services.TryAdd(ServiceDescriptor.Singleton(typeof(DefaultTypedHttpClientFactory<>.Cache), typeof(DefaultTypedHttpClientFactory<>.Cache))); 53services.TryAddEnumerable(ServiceDescriptor.Singleton<IHttpMessageHandlerBuilderFilter, LoggingHttpMessageHandlerBuilderFilter>()); 55services.TryAddEnumerable(ServiceDescriptor.Singleton<IHttpMessageHandlerBuilderFilter, MetricsFactoryHttpMessageHandlerFilter>());
DependencyInjection\HttpClientKeyedLifetime.cs (6)
15public ServiceDescriptor Client { get; } 16public ServiceDescriptor Handler { get; } 20private HttpClientKeyedLifetime(object serviceKey, ServiceDescriptor client, ServiceDescriptor handler) 31Client = ServiceDescriptor.DescribeKeyed(typeof(HttpClient), ServiceKey, CreateKeyedClient, lifetime); 32Handler = ServiceDescriptor.DescribeKeyed(typeof(HttpMessageHandler), ServiceKey, CreateKeyedHandler, lifetime);
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (6)
HttpClientFactory.cs (6)
18services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, DropMessageLoggerProvider>()); 42services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, DropMessageLoggerProvider>()); 65services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, DropMessageLoggerProvider>()); 92services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, DropMessageLoggerProvider>()); 115services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, DropMessageLoggerProvider>()); 138services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, DropMessageLoggerProvider>());
Microsoft.Extensions.Http.Polly (3)
DependencyInjection\PollyServiceCollectionExtensions.cs (3)
39services.TryAddEnumerable(ServiceDescriptor.Singleton<IPolicyRegistry<string>>(registry)); 40services.TryAddEnumerable(ServiceDescriptor.Singleton<IReadOnlyPolicyRegistry<string>>(registry)); 44services.TryAddEnumerable(ServiceDescriptor.Singleton<IConcurrentPolicyRegistry<string>>(concurrentRegistry));
Microsoft.Extensions.Http.Resilience (2)
Resilience\ResilienceHttpClientBuilderExtensions.Resilience.cs (2)
150public static readonly ServiceDescriptor ServiceDescriptor = ServiceDescriptor.Singleton<Marker, Marker>();
Microsoft.Extensions.Logging (4)
LoggingBuilderExtensions.cs (1)
24builder.Services.Add(ServiceDescriptor.Singleton<IConfigureOptions<LoggerFilterOptions>>(
LoggingServiceCollectionExtensions.cs (3)
38services.TryAdd(ServiceDescriptor.Singleton<ILoggerFactory, LoggerFactory>()); 39services.TryAdd(ServiceDescriptor.Singleton(typeof(ILogger<>), typeof(Logger<>))); 41services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<LoggerFilterOptions>>(
Microsoft.Extensions.Logging.AzureAppServices (2)
AzureAppServicesLoggerFactoryExtensions.cs (2)
11using static Microsoft.Extensions.DependencyInjection.ServiceDescriptor; 90private static bool TryAddEnumerable(IServiceCollection collection, ServiceDescriptor descriptor)
Microsoft.Extensions.Logging.Configuration (2)
LoggerProviderConfigurationExtensions.cs (2)
29services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<TOptions>, LoggerProviderConfigureOptions<TOptions, TProvider>>()); 30services.TryAddEnumerable(ServiceDescriptor.Singleton<IOptionsChangeTokenSource<TOptions>, LoggerProviderOptionsChangeTokenSource<TOptions, TProvider>>());
Microsoft.Extensions.Logging.Console (6)
ConsoleLoggerExtensions.cs (6)
38builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, ConsoleLoggerProvider>()); 40builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<ConsoleLoggerOptions>, ConsoleLoggerConfigureOptions>()); 41builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IOptionsChangeTokenSource<ConsoleLoggerOptions>, LoggerProviderOptionsChangeTokenSource<ConsoleLoggerOptions, ConsoleLoggerProvider>>()); 164builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ConsoleFormatter, TFormatter>()); 165builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<TOptions>, TConfigureOptions>()); 166builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IOptionsChangeTokenSource<TOptions>, ConsoleLoggerFormatterOptionsChangeTokenSource<TFormatter, TOptions>>());
Microsoft.Extensions.Logging.Debug (1)
DebugLoggerFactoryExtensions.cs (1)
53builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, DebugLoggerProvider>());
Microsoft.Extensions.Logging.EventLog (2)
EventLoggerFactoryExtensions.cs (2)
60builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, EventLogLoggerProvider>()); 76builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider>(new EventLogLoggerProvider(settings)));
Microsoft.Extensions.Logging.EventSource (3)
EventSourceLoggerFactoryExtensions.cs (3)
44builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, EventSourceLoggerProvider>()); 45builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<LoggerFilterOptions>, EventLogFiltersConfigureOptions>()); 46builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IOptionsChangeTokenSource<LoggerFilterOptions>, EventLogFiltersConfigureOptionsChangeSource>());
Microsoft.Extensions.ML (1)
ServiceCollectionExtensions.cs (1)
83.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<MLOptions>, PostMLContextOptionsConfiguration>());
Microsoft.Extensions.Options (6)
OptionsServiceCollectionExtensions.cs (6)
26services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptions<>), typeof(UnnamedOptionsManager<>))); 27services.TryAdd(ServiceDescriptor.Scoped(typeof(IOptionsSnapshot<>), typeof(OptionsManager<>))); 28services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptionsMonitor<>), typeof(OptionsMonitor<>))); 29services.TryAdd(ServiceDescriptor.Transient(typeof(IOptionsFactory<>), typeof(OptionsFactory<>))); 30services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptionsMonitorCache<>), typeof(OptionsCache<>))); 72services.AddOptions().TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<TOptions>, TValidateOptions>());
Microsoft.Extensions.Options.Contextual (3)
ContextualOptionsServiceCollectionExtensions.cs (3)
29services.TryAdd(ServiceDescriptor.Singleton(typeof(IContextualOptionsFactory<>), typeof(ContextualOptionsFactory<>))); 30services.TryAdd(ServiceDescriptor.Singleton(typeof(IContextualOptions<,>), typeof(ContextualOptions<,>))); 31services.TryAdd(ServiceDescriptor.Singleton(typeof(INamedContextualOptions<,>), typeof(ContextualOptions<,>)));
Microsoft.Extensions.ServiceDiscovery (1)
ServiceDiscoveryHttpClientBuilderExtensions.cs (1)
47services.TryAddEnumerable(ServiceDescriptor.Singleton<IHttpMessageHandlerBuilderFilter, DisableGrpcLoadBalancingFilter>());
Microsoft.Extensions.Telemetry (4)
Logging\LoggingEnrichmentExtensions.cs (2)
37builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerFactory, ExtendedLoggerFactory>()); 55builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerFactory, ExtendedLoggerFactory>());
Logging\LoggingRedactionExtensions.cs (2)
37builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerFactory, ExtendedLoggerFactory>()); 54builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerFactory, ExtendedLoggerFactory>());
Microsoft.ML.AutoML (2)
AutoMLExperiment\AutoMLExperiment.cs (2)
177var descriptor = ServiceDescriptor.Singleton<ITuner>(factory);
Mvc.RoutingWebSite (1)
StartupWithoutEndpointRouting.cs (1)
86services.TryAddEnumerable(ServiceDescriptor.Singleton<IActionDescriptorProvider>(actionDescriptorProvider));