12 references to AddKeyedSingleton
Aspire.Azure.Messaging.EventHubs.Tests (1)
AspireEventHubsExtensionsTests.cs (1)
63
services.
AddKeyedSingleton
("blobs", blobClient);
BasicTestApp (2)
Program.cs (2)
45
builder.Services.
AddKeyedSingleton
("keyed-service-1", TestKeyedService.Create("value-1"));
46
builder.Services.
AddKeyedSingleton
(TestServiceKey.ServiceB, TestKeyedService.Create("value-2"));
Microsoft.AspNetCore.Http.Extensions.Tests (7)
RequestDelegateGenerator\RequestDelegateCreationTests.KeyServices.cs (7)
22
var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.
AddKeyedSingleton
("service1", myOriginalService));
38
var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.
AddKeyedSingleton
("service1", myOriginalService));
66
serviceCollection.
AddKeyedSingleton
("", myOriginalService1);
88
var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.
AddKeyedSingleton
('a', myOriginalService));
108
var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.
AddKeyedSingleton
(key, myOriginalService));
163
serviceCollection.
AddKeyedSingleton
("service1", myOriginalService1);
191
serviceCollection.
AddKeyedSingleton
("service1", myOriginalService1);
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1535
serviceCollection.
AddKeyedSingleton
("foo", new InferredServiceClass());
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorPageActivatorTest.cs (1)
252
.
AddKeyedSingleton
(KeyedServiceKey, myService)