30 instantiations of ServiceDescriptor
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL (1)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
Aspire.MongoDB.EntityFrameworkCore (1)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (1)
Aspire.Oracle.EntityFrameworkCore (1)
Aspire.Pomelo.EntityFrameworkCore.MySql (1)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
Microsoft.Extensions.AI (10)
Embeddings\EmbeddingGeneratorBuilderServiceCollectionExtensions.cs (4)
55serviceCollection.Add(new ServiceDescriptor(typeof(IEmbeddingGenerator<TInput, TEmbedding>), builder.Build, lifetime));
56serviceCollection.Add(new ServiceDescriptor(typeof(IEmbeddingGenerator),
107serviceCollection.Add(new ServiceDescriptor(typeof(IEmbeddingGenerator<TInput, TEmbedding>), serviceKey, factory: (services, serviceKey) => builder.Build(services), lifetime));
108serviceCollection.Add(new ServiceDescriptor(typeof(IEmbeddingGenerator), serviceKey,
Microsoft.Extensions.DependencyInjection.Abstractions (12)
ServiceDescriptor.cs (6)
936return new ServiceDescriptor(serviceType, implementationInstance);
956return new ServiceDescriptor(serviceType, serviceKey, implementationInstance);
986return new ServiceDescriptor(serviceType, implementationType, lifetime);
1005return new ServiceDescriptor(serviceType, serviceKey, implementationType, lifetime);
1019return new ServiceDescriptor(serviceType, implementationFactory, lifetime);
1034return new ServiceDescriptor(serviceType, serviceKey, implementationFactory, lifetime);
829 references to ServiceDescriptor
aspire (7)
Aspire.Azure.AI.Inference (2)
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.Npgsql (1)
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL (5)
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (5)
Aspire.Azure.Search.Documents (1)
Aspire.Azure.Security.KeyVault (3)
Aspire.Azure.Storage.Blobs (2)
Aspire.Azure.Storage.Files.DataLake (1)
Aspire.Azure.Storage.Queues (3)
Aspire.Cli.Tests (6)
Aspire.Confluent.Kafka (2)
Aspire.Dashboard (2)
Aspire.Dashboard.Tests (1)
Aspire.Hosting (12)
Aspire.Hosting.Testing (5)
Aspire.Hosting.Tests (1)
Aspire.Microsoft.Azure.Cosmos (3)
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.MongoDB.EntityFrameworkCore (5)
Aspire.MongoDB.EntityFrameworkCore.Tests (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 (2)
Aspire.StackExchange.Redis.DistributedCaching (2)
Aspire.StackExchange.Redis.OutputCaching (1)
AspireWithMaui.MauiServiceDefaults (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 (7)
Microsoft.AspNetCore.Components (7)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
Microsoft.AspNetCore.Components.Server (5)
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Components.WebView.Test (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.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 (14)
Microsoft.AspNetCore.OpenApi (1)
Microsoft.AspNetCore.Routing (8)
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
Microsoft.AspNetCore.Server.Kestrel (3)
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.AI.Tests (10)
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 (36)
ServiceLookup\CallSiteFactory.cs (19)
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)
300ServiceDescriptor descriptor = descriptors[i];
464private ServiceCallSite? TryCreateExact(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot)
477private ServiceCallSite CreateExact(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot)
512private ServiceCallSite? TryCreateOpenGeneric(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot, bool throwOnConstraintViolation)
533private ServiceCallSite? CreateOpenGeneric(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot, bool throwOnConstraintViolation)
826private ServiceDescriptor? _item;
829private List<ServiceDescriptor>? _items;
831public ServiceDescriptor Last
859public ServiceDescriptor this[int index]
877public int GetSlot(ServiceDescriptor descriptor)
896public ServiceDescriptorCacheItem Add(ServiceDescriptor descriptor)
907newCacheItem._items = _items ?? new List<ServiceDescriptor>();
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)
113var descriptor = ServiceDescriptor.Transient(service, service);
135var descriptor = ServiceDescriptor.Transient(service, implementationType);
157var descriptor = ServiceDescriptor.Transient(service, implementationFactory);
208services.TryAdd(ServiceDescriptor.Transient(implementationFactory));
225var descriptor = ServiceDescriptor.Scoped(service, service);
247var descriptor = ServiceDescriptor.Scoped(service, implementationType);
269var descriptor = ServiceDescriptor.Scoped(service, implementationFactory);
320services.TryAdd(ServiceDescriptor.Scoped(implementationFactory));
337var descriptor = ServiceDescriptor.Singleton(service, service);
359var descriptor = ServiceDescriptor.Singleton(service, implementationType);
381var descriptor = ServiceDescriptor.Singleton(service, implementationFactory);
433var descriptor = ServiceDescriptor.Singleton(serviceType: typeof(TService), implementationInstance: instance);
451services.TryAdd(ServiceDescriptor.Singleton(implementationFactory));
455/// Adds a <see cref="ServiceDescriptor"/> if an existing descriptor with the same
456/// <see cref="ServiceDescriptor.ServiceType"/> and an implementation that does not already exist
460/// <param name="descriptor">The <see cref="ServiceDescriptor"/>.</param>
462/// Use <see cref="TryAddEnumerable(IServiceCollection, ServiceDescriptor)"/> when registering a service implementation of a
465/// <see cref="Add(IServiceCollection, ServiceDescriptor)"/> is not idempotent and can add
467/// <see cref="ServiceDescriptor"/> instances if called twice. Using
468/// <see cref="TryAddEnumerable(IServiceCollection, ServiceDescriptor)"/> will prevent registration
473ServiceDescriptor descriptor)
493ServiceDescriptor service = services[i];
507/// Adds the specified <see cref="ServiceDescriptor"/>s if an existing descriptor with the same
508/// <see cref="ServiceDescriptor.ServiceType"/> and an implementation that does not already exist
512/// <param name="descriptors">The <see cref="ServiceDescriptor"/>s.</param>
514/// Use <see cref="TryAddEnumerable(IServiceCollection, ServiceDescriptor)"/> when registering a service
517/// <see cref="Add(IServiceCollection, ServiceDescriptor)"/> is not idempotent and can add
519/// <see cref="ServiceDescriptor"/> instances if called twice. Using
520/// <see cref="TryAddEnumerable(IServiceCollection, ServiceDescriptor)"/> will prevent registration
525IEnumerable<ServiceDescriptor> descriptors)
530foreach (ServiceDescriptor? d in descriptors)
541/// <param name="descriptor">The <see cref="ServiceDescriptor"/> to replace with.</param>
545ServiceDescriptor descriptor)
587ServiceDescriptor? descriptor = collection[i];
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (24)
28var descriptor = ServiceDescriptor.KeyedTransient(service, serviceKey, service);
52var descriptor = ServiceDescriptor.KeyedTransient(service, serviceKey, implementationType);
76var descriptor = ServiceDescriptor.KeyedTransient(service, serviceKey, implementationFactory);
131services.TryAdd(ServiceDescriptor.KeyedTransient(serviceKey, implementationFactory));
150var descriptor = ServiceDescriptor.KeyedScoped(service, serviceKey, service);
174var descriptor = ServiceDescriptor.KeyedScoped(service, serviceKey, implementationType);
198var descriptor = ServiceDescriptor.KeyedScoped(service, serviceKey, implementationFactory);
253services.TryAdd(ServiceDescriptor.KeyedScoped(serviceKey, implementationFactory));
272var descriptor = ServiceDescriptor.KeyedSingleton(service, serviceKey, service);
296var descriptor = ServiceDescriptor.KeyedSingleton(service, serviceKey, implementationType);
320var descriptor = ServiceDescriptor.KeyedSingleton(service, serviceKey, implementationFactory);
375var descriptor = ServiceDescriptor.KeyedSingleton(serviceType: typeof(TService), serviceKey, implementationInstance: instance);
395services.TryAdd(ServiceDescriptor.KeyedSingleton(serviceKey, implementationFactory));
422ServiceDescriptor? descriptor = collection[i];
ServiceDescriptor.cs (143)
18/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="implementationType"/>.
32/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="implementationType"/>.
35/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
52/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="instance"/>
65/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="instance"/>
69/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
84/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="factory"/>.
102/// Initializes a new instance of <see cref="ServiceDescriptor"/> with the specified <paramref name="factory"/>.
105/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
354/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
360/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
361public static ServiceDescriptor Transient<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>()
369/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
375/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
376/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
377public static ServiceDescriptor KeyedTransient<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(object? serviceKey)
385/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
391/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
392public static ServiceDescriptor Transient(
403/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
408/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
410/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
411public static ServiceDescriptor KeyedTransient(
423/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
431/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
432public static ServiceDescriptor Transient<TService, TImplementation>(
443/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
450/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
452/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
453public static ServiceDescriptor KeyedTransient<TService, TImplementation>(
465/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
471/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
472public static ServiceDescriptor Transient<TService>(Func<IServiceProvider, TService> implementationFactory)
481/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
486/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
488/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
489public static ServiceDescriptor KeyedTransient<TService>(object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory)
498/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
504/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
505public static ServiceDescriptor Transient(Type service, Func<IServiceProvider, object> implementationFactory)
514/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
519/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
521/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
522public static ServiceDescriptor KeyedTransient(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory)
531/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
537/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
538public static ServiceDescriptor Scoped<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>()
546/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
552/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
553/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
554public static ServiceDescriptor KeyedScoped<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(object? serviceKey)
562/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
568/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
569public static ServiceDescriptor Scoped(
577/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
582/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
584/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
585public static ServiceDescriptor KeyedScoped(
594/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
602/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
603public static ServiceDescriptor Scoped<TService, TImplementation>(
614/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
621/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
623/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
624public static ServiceDescriptor KeyedScoped<TService, TImplementation>(
636/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
642/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
643public static ServiceDescriptor Scoped<TService>(Func<IServiceProvider, TService> implementationFactory)
652/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
657/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
659/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
660public static ServiceDescriptor KeyedScoped<TService>(object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory)
669/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
675/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
676public static ServiceDescriptor Scoped(Type service, Func<IServiceProvider, object> implementationFactory)
685/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
690/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
692/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
693public static ServiceDescriptor KeyedScoped(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory)
702/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
708/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
709public static ServiceDescriptor Singleton<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>()
717/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
723/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
724/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
725public static ServiceDescriptor KeyedSingleton<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
734/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
740/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
741public static ServiceDescriptor Singleton(
752/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
757/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
759/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
760public static ServiceDescriptor KeyedSingleton(
772/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
780/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
781public static ServiceDescriptor Singleton<TService, TImplementation>(
792/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
799/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
801/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
802public static ServiceDescriptor KeyedSingleton<TService, TImplementation>(
814/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
820/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
821public static ServiceDescriptor Singleton<TService>(Func<IServiceProvider, TService> implementationFactory)
830/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
835/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
837/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
838public static ServiceDescriptor KeyedSingleton<TService>(
849/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
855/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
856public static ServiceDescriptor Singleton(
867/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
872/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
874/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
875public static ServiceDescriptor KeyedSingleton(
887/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
893/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
894public static ServiceDescriptor Singleton<TService>(TService implementationInstance)
903/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
908/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
910/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
911public static ServiceDescriptor KeyedSingleton<TService>(
922/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
928/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
929public static ServiceDescriptor Singleton(
940/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
945/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
947/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
948public static ServiceDescriptor KeyedSingleton(
959private static ServiceDescriptor DescribeKeyed<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
973/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
980/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
981public static ServiceDescriptor Describe(
990/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
995/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
998/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
999public static ServiceDescriptor DescribeKeyed(
1009/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
1016/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
1017public static ServiceDescriptor Describe(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime)
1023/// Creates an instance of <see cref="ServiceDescriptor"/> with the specified
1028/// <param name="serviceKey">The <see cref="ServiceDescriptor.ServiceKey"/> of the service.</param>
1031/// <returns>A new instance of <see cref="ServiceDescriptor"/>.</returns>
1032public 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.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 (4)
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 (3)
Microsoft.Maui (26)
Microsoft.Maui.Controls.Compatibility (1)
Microsoft.ML.AutoML (2)