23 references to Singleton
Microsoft.AspNetCore.Authentication.Negotiate (1)
NegotiateExtensions.cs (1)
72builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IStartupFilter>(new NegotiateOptionsValidationStartupFilter(authenticationScheme)));
Microsoft.AspNetCore.DataProtection.Tests (3)
HostingTests.cs (3)
33.Replace(ServiceDescriptor.Singleton(mockKeyRing.Object)) 59.Replace(ServiceDescriptor.Singleton(mockKeyRing.Object)) 88.Replace(ServiceDescriptor.Singleton(mockKeyRing.Object))
Microsoft.AspNetCore.Hosting (1)
WebHostBuilderExtensions.cs (1)
205services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IServiceCollection>>(new DefaultServiceProviderFactory(options)));
Microsoft.AspNetCore.Hosting.Tests (1)
WebHostTests.AsyncDisposable.cs (1)
17services.Add(ServiceDescriptor.Singleton<IServiceProviderFactory<IServiceCollection>>(providerFactory)
Microsoft.AspNetCore.Mvc.Core.Test (3)
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.Routing.Microbenchmarks (1)
EndpointRoutingBenchmarkBase.cs (1)
35ServiceDescriptor.Singleton<EndpointDataSource>(new DefaultEndpointDataSource(Endpoints)));
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
VersionStartup.cs (1)
24services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol>(new VersionedJsonHubProtocol(1000)));
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.Extensions.Compliance.Redaction (2)
RedactionBuilder.cs (2)
29Services.TryAddEnumerable(ServiceDescriptor.Singleton<Redactor>(ErasingRedactor.Instance)); 30Services.TryAddEnumerable(ServiceDescriptor.Singleton<Redactor>(NullRedactor.Instance));
Microsoft.Extensions.Diagnostics.Abstractions (1)
Metrics\MetricsBuilderExtensions.Listeners.cs (1)
38builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton(listener));
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.Logging (2)
LoggingBuilderExtensions.cs (1)
24builder.Services.Add(ServiceDescriptor.Singleton<IConfigureOptions<LoggerFilterOptions>>(
LoggingServiceCollectionExtensions.cs (1)
41services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<LoggerFilterOptions>>(
Microsoft.Extensions.Logging.EventLog (1)
EventLoggerFactoryExtensions.cs (1)
76builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider>(new EventLogLoggerProvider(settings)));
Mvc.RoutingWebSite (1)
StartupWithoutEndpointRouting.cs (1)
86services.TryAddEnumerable(ServiceDescriptor.Singleton<IActionDescriptorProvider>(actionDescriptorProvider));