17 references to AddKeyedSingleton
Aspire.Azure.Messaging.EventHubs.Tests (1)
AspireEventHubsExtensionsTests.cs (1)
65services.AddKeyedSingleton("blobs", blobClient);
Aspire.Hosting.Azure.Tests (1)
ContainerRegistryTests.cs (1)
89builder.Services.AddKeyedSingleton<IDistributedApplicationPublisher>("test-publisher", publisherValidator);
Aspire.Hosting.Tests (9)
Publishing\ResourceContainerImageManagerTests.cs (9)
449builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 473builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 503builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 538builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 567builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 607builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", new FakeContainerRuntime(shouldFail: true)); 642builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 702builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 811builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime);
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1778serviceCollection.AddKeyedSingleton("foo", new InferredServiceClass());
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorPageActivatorTest.cs (1)
252.AddKeyedSingleton(KeyedServiceKey, myService)
Microsoft.Extensions.AI.Tests (2)
Functions\AIFunctionFactoryTest.cs (2)
593sc.AddKeyedSingleton("key", service); 639sc.AddKeyedSingleton("key", service);
Microsoft.Extensions.Caching.Hybrid.Tests (2)
SerializerTests.cs (2)
246services.AddKeyedSingleton<JsonSerializerOptions>(typeof(IHybridCacheSerializer<>), globalOptions); 252services.AddKeyedSingleton<JsonSerializerOptions>(typeof(IHybridCacheSerializer<T>), perTypeOptions);