25 references to AddKeyedSingleton
Aspire.Azure.AI.OpenAI (1)
src\Components\Common\AzureComponent.cs (1)
109builder.Services.AddKeyedSingleton(serviceKey,
Aspire.Azure.Data.Tables (1)
src\Components\Common\AzureComponent.cs (1)
109builder.Services.AddKeyedSingleton(serviceKey,
Aspire.Azure.Messaging.EventHubs (1)
src\Components\Common\AzureComponent.cs (1)
109builder.Services.AddKeyedSingleton(serviceKey,
Aspire.Azure.Messaging.ServiceBus (1)
src\Components\Common\AzureComponent.cs (1)
109builder.Services.AddKeyedSingleton(serviceKey,
Aspire.Azure.Messaging.WebPubSub (1)
src\Components\Common\AzureComponent.cs (1)
109builder.Services.AddKeyedSingleton(serviceKey,
Aspire.Azure.Search.Documents (1)
src\Components\Common\AzureComponent.cs (1)
109builder.Services.AddKeyedSingleton(serviceKey,
Aspire.Azure.Security.KeyVault (1)
src\Components\Common\AzureComponent.cs (1)
109builder.Services.AddKeyedSingleton(serviceKey,
Aspire.Azure.Storage.Blobs (1)
src\Components\Common\AzureComponent.cs (1)
109builder.Services.AddKeyedSingleton(serviceKey,
Aspire.Azure.Storage.Queues (1)
src\Components\Common\AzureComponent.cs (1)
109builder.Services.AddKeyedSingleton(serviceKey,
Aspire.Confluent.Kafka (4)
AspireKafkaConsumerExtensions.cs (2)
121builder.Services.AddKeyedSingleton<ConsumerConnectionFactory<TKey, TValue>>(serviceKey, (sp, key) => CreateConsumerConnectionFactory<TKey, TValue>(sp, configureBuilder, settings)); 122builder.Services.AddKeyedSingleton<IConsumer<TKey, TValue>>(serviceKey, (sp, key) => sp.GetRequiredKeyedService<ConsumerConnectionFactory<TKey, TValue>>(key).Create());
AspireKafkaProducerExtensions.cs (2)
121builder.Services.AddKeyedSingleton<ProducerConnectionFactory<TKey, TValue>>(serviceKey, (sp, key) => CreateProducerConnectionFactory<TKey, TValue>(sp, configureBuilder, settings)); 122builder.Services.AddKeyedSingleton<IProducer<TKey, TValue>>(serviceKey, (sp, key) => sp.GetRequiredKeyedService<ProducerConnectionFactory<TKey, TValue>>(key).Create());
Aspire.Elastic.Clients.Elasticsearch (1)
AspireElasticClientsElasticsearchExtensions.cs (1)
95builder.Services.AddKeyedSingleton<ElasticsearchClient>(serviceKey, (sp, key) => CreateElasticsearchClient(sp));
Aspire.Microsoft.Azure.Cosmos (1)
AspireMicrosoftAzureCosmosExtensions.cs (1)
120builder.Services.AddKeyedSingleton(serviceKey, (sp, key) => ConfigureDb());
Aspire.Milvus.Client (1)
AspireMilvusExtensions.cs (1)
87builder.Services.AddKeyedSingleton(serviceKey, (sp, key) => ConfigureMilvus(sp));
Aspire.MongoDB.Driver (2)
AspireMongoDBDriverExtensions.cs (2)
119.AddKeyedSingleton<IMongoClient>(serviceKey, (sp, _) => sp.CreateMongoClient(connectionName, mongoDbSettings, configureClientSettings)); 151builder.Services.AddKeyedSingleton<IMongoDatabase>(serviceKey, (provider, _) =>
Aspire.OpenAI (1)
AspireOpenAIExtensions.cs (1)
108builder.Services.AddKeyedSingleton(serviceKey, (sp, key) => ConfigureOpenAI(sp));
Aspire.Qdrant.Client (1)
AspireQdrantExtensions.cs (1)
82builder.Services.AddKeyedSingleton(serviceKey, (sp, key) => ConfigureQdrant(sp));
Aspire.RabbitMQ.Client (1)
AspireRabbitMQExtensions.cs (1)
119builder.Services.AddKeyedSingleton<IConnectionFactory>(serviceKey, (sp, _) => CreateConnectionFactory(sp));
Aspire.StackExchange.Redis (1)
AspireRedisExtensions.cs (1)
106builder.Services.AddKeyedSingleton<IConnectionMultiplexer>(serviceKey, (sp, _) => CreateConnection(sp, connectionName, DefaultConfigSectionName, optionsName));
Microsoft.Extensions.AI (2)
ChatCompletion\ChatClientBuilderServiceCollectionExtensions.cs (1)
68_ = serviceCollection.AddKeyedSingleton(serviceKey, (services, _) => builder.Build(services));
Embeddings\EmbeddingGeneratorBuilderServiceCollectionExtensions.cs (1)
80_ = serviceCollection.AddKeyedSingleton(serviceKey, (services, _) => builder.Build(services));
Microsoft.Extensions.DependencyInjection.AutoActivation (1)
AutoActivationExtensions.Keyed.cs (1)
151.AddKeyedSingleton<TService>(serviceKey, implementationFactory)