18 instantiations of ServiceDescriptor
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (1)
Aspire.Oracle.EntityFrameworkCore (1)
Aspire.Pomelo.EntityFrameworkCore.MySql (1)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
Microsoft.Extensions.DependencyInjection.Abstractions (12)
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)
Aspire.Azure.Data.Tables (1)
Aspire.Azure.Messaging.EventHubs (5)
Aspire.Azure.Messaging.ServiceBus (1)
Aspire.Azure.Messaging.WebPubSub (1)
Aspire.Azure.Search.Documents (1)
Aspire.Azure.Security.KeyVault (1)
Aspire.Azure.Storage.Blobs (1)
Aspire.Azure.Storage.Queues (1)
Aspire.Confluent.Kafka (2)
Aspire.Dashboard (2)
Aspire.Elastic.Clients.Elasticsearch (1)
Aspire.Hosting (9)
Aspire.Hosting.Testing (5)
Aspire.Microsoft.Azure.Cosmos (1)
Aspire.Microsoft.Data.SqlClient (1)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (5)
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (1)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (5)
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (5)
Aspire.MongoDB.Driver (1)
Aspire.MySqlConnector (1)
Aspire.NATS.Net (1)
Aspire.Npgsql (1)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (5)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (5)
Aspire.OpenAI (1)
Aspire.Oracle.EntityFrameworkCore (5)
Aspire.Oracle.EntityFrameworkCore.Tests (5)
Aspire.Pomelo.EntityFrameworkCore.MySql (5)
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (5)
Aspire.RabbitMQ.Client (1)
Aspire.StackExchange.Redis (1)
Aspire.StackExchange.Redis.DistributedCaching (1)
Aspire.StackExchange.Redis.OutputCaching (1)
IntegrationTestsWebsite (1)
Microsoft.AspNetCore (7)
Microsoft.AspNetCore.Antiforgery (1)
Microsoft.AspNetCore.AsyncState.Tests (1)
Microsoft.AspNetCore.Authentication (2)
Microsoft.AspNetCore.Authentication.BearerToken (2)
Microsoft.AspNetCore.Authentication.Cookies (1)
Microsoft.AspNetCore.Authentication.JwtBearer (2)
Microsoft.AspNetCore.Authentication.Negotiate (2)
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
Microsoft.AspNetCore.Authentication.Twitter (1)
Microsoft.AspNetCore.Authentication.WsFederation (1)
Microsoft.AspNetCore.Authorization (6)
Microsoft.AspNetCore.Components (4)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
Microsoft.AspNetCore.Components.Server (4)
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Cors (2)
Microsoft.AspNetCore.DataProtection (5)
Microsoft.AspNetCore.DataProtection.Tests (4)
Microsoft.AspNetCore.Diagnostics.Middleware (2)
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Microsoft.AspNetCore.Grpc.Swagger (2)
Microsoft.AspNetCore.Hosting (5)
Microsoft.AspNetCore.Hosting.Tests (4)
Microsoft.AspNetCore.Http.Connections (1)
Microsoft.AspNetCore.Http.Extensions (2)
Microsoft.AspNetCore.Http.Extensions.Tests (2)
Microsoft.AspNetCore.Http.Tests (1)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.Identity (3)
Microsoft.AspNetCore.MiddlewareAnalysis (1)
Microsoft.AspNetCore.Mvc (2)
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
Microsoft.AspNetCore.Mvc.Core (20)
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)
Microsoft.AspNetCore.Mvc.Cors (1)
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
Microsoft.AspNetCore.Mvc.Formatters.Xml (4)
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
Microsoft.AspNetCore.Mvc.Localization (3)
Microsoft.AspNetCore.Mvc.Localization.Test (7)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (5)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (3)
Microsoft.AspNetCore.Mvc.Razor (3)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (7)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
Microsoft.AspNetCore.Mvc.Razor.Test (8)
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)
Microsoft.AspNetCore.Mvc.ViewFeatures (13)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (13)
Microsoft.AspNetCore.OpenApi (1)
Microsoft.AspNetCore.Routing (8)
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
Microsoft.AspNetCore.Server.Kestrel (2)
Microsoft.AspNetCore.SignalR (1)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Microsoft.AspNetCore.SignalR.Tests (2)
Microsoft.AspNetCore.SpaProxy (1)
Microsoft.AspNetCore.Tests (2)
Microsoft.Authentication.WebAssembly.Msal (1)
Microsoft.DotNet.Internal.DependencyInjection.Testing (2)
Microsoft.Extensions.AsyncState.Tests (1)
Microsoft.Extensions.Caching.Memory (2)
Microsoft.Extensions.Caching.SqlServer (1)
Microsoft.Extensions.Caching.SqlServer.Tests (2)
Microsoft.Extensions.Caching.StackExchangeRedis (1)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (3)
Microsoft.Extensions.Compliance.Redaction (4)
Microsoft.Extensions.DependencyInjection (34)
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];
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.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)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (1)
Microsoft.Extensions.Diagnostics.HealthChecks (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (3)
Microsoft.Extensions.Diagnostics.Testing (2)
Microsoft.Extensions.Hosting.Abstractions (2)
Microsoft.Extensions.Http (19)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (6)
Microsoft.Extensions.Http.Polly (3)
Microsoft.Extensions.Http.Resilience (2)
Microsoft.Extensions.Logging (4)
Microsoft.Extensions.Logging.AzureAppServices (2)
Microsoft.Extensions.Logging.Configuration (2)
Microsoft.Extensions.Logging.Console (6)
Microsoft.Extensions.Logging.Debug (1)
Microsoft.Extensions.Logging.EventLog (2)
Microsoft.Extensions.Logging.EventSource (3)
Microsoft.Extensions.ML (1)
Microsoft.Extensions.Options (6)
Microsoft.Extensions.Options.Contextual (3)
Microsoft.Extensions.ServiceDiscovery (1)
Microsoft.Extensions.Telemetry (4)
Microsoft.ML.AutoML (2)
Mvc.RoutingWebSite (1)