22 references to Singleton
Aspire.Hosting (1)
Dashboard\DashboardServiceHost.cs (1)
107builder.Services.Add(ServiceDescriptor.Singleton(typeof(ILogger<>), typeof(Logger<>)));
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
HotReloadServiceTests.cs (1)
220services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(RenderModeEndpointProvider), type));
RazorComponentEndpointDataSourceTest.cs (1)
223services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(RenderModeEndpointProvider), type));
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
GrpcJsonTranscodingServiceExtensions.cs (1)
28builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(IServiceMethodProvider<>), typeof(JsonTranscodingServiceMethodProvider<>)));
Microsoft.AspNetCore.Mvc.Localization.Test (1)
MvcLocalizationServiceCollectionExtensionsTest.cs (1)
38collection.Add(ServiceDescriptor.Singleton(typeof(IHtmlLocalizerFactory), typeof(TestHtmlLocalizerFactory)));
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
DependencyInjection\MvcViewFeaturesMvcBuilderExtensions.cs (2)
71var descriptor = ServiceDescriptor.Singleton(typeof(ITempDataProvider), typeof(SessionStateTempDataProvider)); 90var descriptor = ServiceDescriptor.Singleton(typeof(ITempDataProvider), typeof(CookieTempDataProvider));
DependencyInjection\MvcViewFeaturesMvcCoreBuilderExtensions.cs (1)
56var descriptor = ServiceDescriptor.Singleton(typeof(ITempDataProvider), typeof(CookieTempDataProvider));
Microsoft.Extensions.Compliance.Redaction (2)
RedactionBuilder.cs (2)
41Services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(Redactor), redactorType)); 51Services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(Redactor), typeof(T)));
Microsoft.Extensions.DependencyInjection.Abstractions (2)
Extensions\ServiceCollectionDescriptorExtensions.cs (2)
324var descriptor = ServiceDescriptor.Singleton(service, service); 345var descriptor = ServiceDescriptor.Singleton(service, implementationType);
Microsoft.Extensions.DependencyInjection.AutoActivation (2)
AutoActivationExtensions.cs (2)
235services.TryAddAndActivate(ServiceDescriptor.Singleton(serviceType, serviceType)); 253services.TryAddAndActivate(ServiceDescriptor.Singleton(serviceType, implementationType));
Microsoft.Extensions.Http (1)
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (1)
48services.TryAdd(ServiceDescriptor.Singleton(typeof(DefaultTypedHttpClientFactory<>.Cache), typeof(DefaultTypedHttpClientFactory<>.Cache)));
Microsoft.Extensions.Logging (1)
LoggingServiceCollectionExtensions.cs (1)
39services.TryAdd(ServiceDescriptor.Singleton(typeof(ILogger<>), typeof(Logger<>)));
Microsoft.Extensions.Options (3)
OptionsServiceCollectionExtensions.cs (3)
26services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptions<>), typeof(UnnamedOptionsManager<>))); 28services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptionsMonitor<>), typeof(OptionsMonitor<>))); 30services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptionsMonitorCache<>), typeof(OptionsCache<>)));
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<,>)));