7 references to Singleton
Microsoft.AspNetCore.Hosting (3)
WebHostBuilder.cs (3)
355
services.Replace(ServiceDescriptor.
Singleton
(typeof(DiagnosticListener), listener!));
356
services.Replace(ServiceDescriptor.
Singleton
(typeof(DiagnosticSource), listener!));
359
services.Replace(ServiceDescriptor.
Singleton
(typeof(ActivitySource), activitySource!));
Microsoft.AspNetCore.Http.Extensions.Tests (1)
ProblemDetailsServiceCollectionExtensionsTest.cs (1)
56
collection.TryAddEnumerable(ServiceDescriptor.
Singleton
(typeof(IProblemDetailsWriter), mockWriter));
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
HubConnectionReceiveBenchmark.cs (1)
72
hubConnectionBuilder.Services.TryAddEnumerable(ServiceDescriptor.
Singleton
(typeof(IHubProtocol), hubProtocol));
Microsoft.Extensions.DependencyInjection.Abstractions (2)
Extensions\ServiceCollectionDescriptorExtensions.cs (1)
415
var descriptor = ServiceDescriptor.
Singleton
(serviceType: typeof(TService), implementationInstance: instance);
ServiceDescriptor.cs (1)
877
return
Singleton
(serviceType: typeof(TService), implementationInstance: implementationInstance);