151 references to GetRequiredKeyedService
Aspire.Azure.AI.OpenAI (2)
AspireAzureOpenAIExtensions.cs (1)
70builder.Services.TryAddKeyedSingleton(typeof(OpenAIClient), serviceKey: name, static (provider, key) => provider.GetRequiredKeyedService<AzureOpenAIClient>(key));
src\Components\Common\AzureComponent.cs (1)
127: serviceProvider.GetRequiredKeyedService<TClient>(serviceKey);
Aspire.Azure.AI.OpenAI.Tests (12)
AspireAzureAIOpenAIExtensionsTests.cs (6)
45host.Services.GetRequiredKeyedService<AzureOpenAIClient>("openai") : 49host.Services.GetRequiredKeyedService<OpenAIClient>("openai") : 76host.Services.GetRequiredKeyedService<AzureOpenAIClient>("openai") : 102host.Services.GetRequiredKeyedService<AzureOpenAIClient>("openai") : 146var client2 = host.Services.GetRequiredKeyedService<AzureOpenAIClient>("openai2"); 147var client3 = host.Services.GetRequiredKeyedService<AzureOpenAIClient>("openai3");
AspireConfigurableOpenAIExtensionsTests.cs (6)
59host.Services.GetRequiredKeyedService<OpenAIClient>("openai") : 86host.Services.GetRequiredKeyedService<OpenAIClient>("openai") : 113host.Services.GetRequiredKeyedService<OpenAIClient>("openai") : 159host.Services.GetRequiredKeyedService<OpenAIClient>("openai") : 186host.Services.GetRequiredKeyedService<OpenAIClient>("openai") : 213host.Services.GetRequiredKeyedService<OpenAIClient>("openai") :
Aspire.Azure.Data.Tables (1)
src\Components\Common\AzureComponent.cs (1)
127: serviceProvider.GetRequiredKeyedService<TClient>(serviceKey);
Aspire.Azure.Data.Tables.Tests (6)
AspireTablesExtensionsTests.cs (6)
37host.Services.GetRequiredKeyedService<TableServiceClient>("tables") : 64host.Services.GetRequiredKeyedService<TableServiceClient>("tables") : 94host.Services.GetRequiredKeyedService<TableServiceClient>("tables") : 122host.Services.GetRequiredKeyedService<TableServiceClient>("tables") : 146var client2 = host.Services.GetRequiredKeyedService<TableServiceClient>("tables2"); 147var client3 = host.Services.GetRequiredKeyedService<TableServiceClient>("tables3");
Aspire.Azure.Messaging.EventHubs (1)
src\Components\Common\AzureComponent.cs (1)
127: serviceProvider.GetRequiredKeyedService<TClient>(serviceKey);
Aspire.Azure.Messaging.ServiceBus (1)
src\Components\Common\AzureComponent.cs (1)
127: serviceProvider.GetRequiredKeyedService<TClient>(serviceKey);
Aspire.Azure.Messaging.ServiceBus.Tests (6)
AspireServiceBusExtensionsTests.cs (6)
37host.Services.GetRequiredKeyedService<ServiceBusClient>("sb") : 64host.Services.GetRequiredKeyedService<ServiceBusClient>("sb") : 94host.Services.GetRequiredKeyedService<ServiceBusClient>("sb") : 122host.Services.GetRequiredKeyedService<ServiceBusClient>("sb") : 146var client2 = host.Services.GetRequiredKeyedService<ServiceBusClient>("sb2"); 147var client3 = host.Services.GetRequiredKeyedService<ServiceBusClient>("sb3");
Aspire.Azure.Messaging.WebPubSub (1)
src\Components\Common\AzureComponent.cs (1)
127: serviceProvider.GetRequiredKeyedService<TClient>(serviceKey);
Aspire.Azure.Messaging.WebPubSub.Tests (7)
AspireWebPubSubExtensionsTests.cs (7)
38host.Services.GetRequiredKeyedService<WebPubSubServiceClient>("wps") : 73host.Services.GetRequiredKeyedService<WebPubSubServiceClient>("wps") : 104host.Services.GetRequiredKeyedService<WebPubSubServiceClient>("wps") : 133host.Services.GetRequiredKeyedService<WebPubSubServiceClient>("wps") : 176var client = host.Services.GetRequiredKeyedService<WebPubSubServiceClient>("key"); 195var client1 = host.Services.GetRequiredKeyedService<WebPubSubServiceClient>("hub1"); 198var client2 = host.Services.GetRequiredKeyedService<WebPubSubServiceClient>("hub2");
Aspire.Azure.Search.Documents (1)
src\Components\Common\AzureComponent.cs (1)
127: serviceProvider.GetRequiredKeyedService<TClient>(serviceKey);
Aspire.Azure.Search.Documents.Tests (4)
AspireAzureSearchExtensionsTests.cs (4)
38host.Services.GetRequiredKeyedService<SearchIndexClient>("search") : 65host.Services.GetRequiredKeyedService<SearchIndexClient>("search") : 90var client2 = host.Services.GetRequiredKeyedService<SearchIndexClient>("search2"); 91var client3 = host.Services.GetRequiredKeyedService<SearchIndexClient>("search3");
Aspire.Azure.Security.KeyVault (1)
src\Components\Common\AzureComponent.cs (1)
127: serviceProvider.GetRequiredKeyedService<TClient>(serviceKey);
Aspire.Azure.Security.KeyVault.Tests (4)
AspireKeyVaultExtensionsTests.cs (4)
40host.Services.GetRequiredKeyedService<SecretClient>("secrets") : 70host.Services.GetRequiredKeyedService<SecretClient>("secrets") : 193var client2 = host.Services.GetRequiredKeyedService<SecretClient>("secrets2"); 194var client3 = host.Services.GetRequiredKeyedService<SecretClient>("secrets3");
Aspire.Azure.Storage.Blobs (1)
src\Components\Common\AzureComponent.cs (1)
127: serviceProvider.GetRequiredKeyedService<TClient>(serviceKey);
Aspire.Azure.Storage.Blobs.Tests (6)
AspireBlobStorageExtensionsTests.cs (6)
37host.Services.GetRequiredKeyedService<BlobServiceClient>("blob") : 64host.Services.GetRequiredKeyedService<BlobServiceClient>("blob") : 94host.Services.GetRequiredKeyedService<BlobServiceClient>("blob") : 122host.Services.GetRequiredKeyedService<BlobServiceClient>("blob") : 146var client2 = host.Services.GetRequiredKeyedService<BlobServiceClient>("blob2"); 147var client3 = host.Services.GetRequiredKeyedService<BlobServiceClient>("blob3");
Aspire.Azure.Storage.Queues (1)
src\Components\Common\AzureComponent.cs (1)
127: serviceProvider.GetRequiredKeyedService<TClient>(serviceKey);
Aspire.Azure.Storage.Queues.Tests (6)
AspireQueueStorageExtensionsTests.cs (6)
37host.Services.GetRequiredKeyedService<QueueServiceClient>("queue") : 64host.Services.GetRequiredKeyedService<QueueServiceClient>("queue") : 94host.Services.GetRequiredKeyedService<QueueServiceClient>("queue") : 122host.Services.GetRequiredKeyedService<QueueServiceClient>("queue") : 146var client2 = host.Services.GetRequiredKeyedService<QueueServiceClient>("queue2"); 147var client3 = host.Services.GetRequiredKeyedService<QueueServiceClient>("queue3");
Aspire.Components.Common.Tests (5)
ConformanceTests.cs (5)
226TService serviceForKey1 = host.Services.GetRequiredKeyedService<TService>(key1); 227TService serviceForKey2 = host.Services.GetRequiredKeyedService<TService>(key2); 281: host.Services.GetRequiredKeyedService<TService>(key); 370: host.Services.GetRequiredKeyedService<TService>(key)); 440: host.Services.GetRequiredKeyedService<TService>(key);
Aspire.Confluent.Kafka (6)
AspireKafkaConsumerExtensions.cs (3)
122builder.Services.AddKeyedSingleton<IConsumer<TKey, TValue>>(serviceKey, (sp, key) => sp.GetRequiredKeyedService<ConsumerConnectionFactory<TKey, TValue>>(key).Create()); 144: sp.GetRequiredKeyedService<ConsumerConnectionFactory<TKey, TValue>>(serviceKey); 155sp => sp.GetRequiredKeyedService<KafkaHealthCheck>(healthCheckName),
AspireKafkaProducerExtensions.cs (3)
122builder.Services.AddKeyedSingleton<IProducer<TKey, TValue>>(serviceKey, (sp, key) => sp.GetRequiredKeyedService<ProducerConnectionFactory<TKey, TValue>>(key).Create()); 144: sp.GetRequiredKeyedService<ProducerConnectionFactory<TKey, TValue>>(serviceKey); 155sp => sp.GetRequiredKeyedService<KafkaHealthCheck>(healthCheckName),
Aspire.Confluent.Kafka.Tests (4)
ConsumerConformanceTests.cs (2)
110var client2 = host.Services.GetRequiredKeyedService<IConsumer<string, string>>("messaging2"); 111var client3 = host.Services.GetRequiredKeyedService<IConsumer<string, string>>("messaging3");
ProducerConformanceTests.cs (2)
101var client2 = host.Services.GetRequiredKeyedService<IProducer<string, string>>("messaging2"); 102var client3 = host.Services.GetRequiredKeyedService<IProducer<string, string>>("messaging3");
Aspire.Elastic.Clients.Elasticsearch (1)
AspireElasticClientsElasticsearchExtensions.cs (1)
113sp.GetRequiredKeyedService<ElasticsearchClient>(serviceKey)),
Aspire.Elastic.Clients.Elasticsearch.Tests (3)
AspireElasticClientExtensionsTest.cs (3)
112var client2 = host.Services.GetRequiredKeyedService<ElasticsearchClient>("elasticsearch2"); 113var client3 = host.Services.GetRequiredKeyedService<ElasticsearchClient>("elasticsearch3"); 136var client2 = host.Services.GetRequiredKeyedService<ElasticsearchClient>("elasticsearch2");
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
407applicationBuilder.Services.AddSingleton<IHost>(sp => new ObservedHost(sp.GetRequiredKeyedService<IHost>(this), this));
Aspire.Hosting.Tests (3)
DistributedApplicationBuilderTests.cs (1)
39Assert.NotNull(app.Services.GetRequiredKeyedService<IDistributedApplicationPublisher>("manifest"));
Helpers\JsonDocumentManifestPublisher.cs (2)
45var publisher = testProgram.App?.Services.GetRequiredKeyedService<IDistributedApplicationPublisher>("manifest") as JsonDocumentManifestPublisher; 51var publisher = services.GetRequiredKeyedService<IDistributedApplicationPublisher>("manifest") as JsonDocumentManifestPublisher;
Aspire.Microsoft.Azure.Cosmos.Tests (2)
ConformanceTests.cs (2)
93var client2 = host.Services.GetRequiredKeyedService<CosmosClient>("cosmosdb2"); 94var client3 = host.Services.GetRequiredKeyedService<CosmosClient>("cosmosdb3");
Aspire.Microsoft.Data.SqlClient.Tests (5)
AspireSqlServerSqlClientExtensionsTests.cs (5)
37host.Services.GetRequiredKeyedService<SqlConnection>("sqlconnection") : 65host.Services.GetRequiredKeyedService<SqlConnection>("sqlconnection") : 97host.Services.GetRequiredKeyedService<SqlConnection>("sqlconnection") : 122var connection2 = host.Services.GetRequiredKeyedService<SqlConnection>("sqlconnection2"); 123var connection3 = host.Services.GetRequiredKeyedService<SqlConnection>("sqlconnection3");
Aspire.Milvus.Client (1)
AspireMilvusExtensions.cs (1)
96: sp.GetRequiredKeyedService<MilvusClient>(serviceKey)),
Aspire.Milvus.Client.Tests (5)
AspireMilvusExtensionTests.cs (3)
50host.Services.GetRequiredKeyedService<MilvusClient>(DefaultKeyName) : 74host.Services.GetRequiredKeyedService<MilvusClient>(DefaultKeyName) : 104host.Services.GetRequiredKeyedService<MilvusClient>(DefaultKeyName) :
ConformanceTests.cs (2)
121var client2 = host.Services.GetRequiredKeyedService<MilvusClient>("milvus2"); 122var client3 = host.Services.GetRequiredKeyedService<MilvusClient>("milvus3");
Aspire.MongoDB.Driver (1)
AspireMongoDBDriverExtensions.cs (1)
154.GetRequiredKeyedService<IMongoClient>(serviceKey)
Aspire.MongoDB.Driver.Tests (3)
AspireMongoDBDriverExtensionsTests.cs (3)
86var mongoClient = host.Services.GetRequiredKeyedService<IMongoClient>(key); 220var connection2 = host.Services.GetRequiredKeyedService<IMongoDatabase>("mongodb2"); 221var connection3 = host.Services.GetRequiredKeyedService<IMongoDatabase>("mongodb3");
Aspire.MySqlConnector (1)
AspireMySqlConnectorExtensions.cs (1)
82: sp.GetRequiredKeyedService<MySqlDataSource>(serviceKey))),
Aspire.MySqlConnector.Tests (5)
AspireMySqlConnectorExtensionsTests.cs (5)
45host.Services.GetRequiredKeyedService<MySqlDataSource>("mysql") : 73host.Services.GetRequiredKeyedService<MySqlDataSource>("mysql") : 105host.Services.GetRequiredKeyedService<MySqlDataSource>("mysql") : 130var connection2 = host.Services.GetRequiredKeyedService<MySqlDataSource>("mysql2"); 131var connection3 = host.Services.GetRequiredKeyedService<MySqlDataSource>("mysql3");
Aspire.NATS.Net (2)
AspireNatsClientExtensions.cs (2)
108builder.Services.TryAddKeyedSingleton<INatsConnection>(serviceKey, static (provider, key) => provider.GetRequiredKeyedService<NatsConnection>(key)); 117: sp.GetRequiredKeyedService<INatsConnection>(serviceKey)),
Aspire.NATS.Net.Tests (5)
AspireNatsClientExtensionsTests.cs (5)
52host.Services.GetRequiredKeyedService<INatsConnection>("nats") : 81host.Services.GetRequiredKeyedService<INatsConnection>("nats") : 113host.Services.GetRequiredKeyedService<INatsConnection>("nats") : 223var connection2 = host.Services.GetRequiredKeyedService<INatsConnection>("nats2"); 224var connection3 = host.Services.GetRequiredKeyedService<INatsConnection>("nats3");
Aspire.Npgsql (4)
AspirePostgreSqlNpgsqlExtensions.cs (4)
85: sp.GetRequiredKeyedService<NpgsqlDataSource>(serviceKey))), 136builder.Services.AddKeyedSingleton<DbDataSource>(serviceKey, static (serviceProvider, key) => serviceProvider.GetRequiredKeyedService<NpgsqlDataSource>(key)); 137builder.Services.AddKeyedTransient<NpgsqlConnection>(serviceKey, static (serviceProvider, key) => serviceProvider.GetRequiredKeyedService<NpgsqlDataSource>(key).CreateConnection()); 138builder.Services.AddKeyedTransient<DbConnection>(serviceKey, static (serviceProvider, key) => serviceProvider.GetRequiredKeyedService<NpgsqlConnection>(key));
Aspire.Npgsql.Tests (6)
AspirePostgreSqlNpgsqlExtensionsTests.cs (6)
37host.Services.GetRequiredKeyedService<NpgsqlDataSource>("npgsql") : 65host.Services.GetRequiredKeyedService<NpgsqlDataSource>("npgsql") : 97host.Services.GetRequiredKeyedService<NpgsqlDataSource>("npgsql") : 129host.Services.GetRequiredKeyedService<NpgsqlDataSource>("npgsql") : 152var connection2 = host.Services.GetRequiredKeyedService<NpgsqlDataSource>("npgsql2"); 153var connection3 = host.Services.GetRequiredKeyedService<NpgsqlDataSource>("npgsql3");
Aspire.OpenAI.Tests (4)
AspireOpenAIExtensionsTests.cs (4)
38host.Services.GetRequiredKeyedService<OpenAIClient>("openai") : 65host.Services.GetRequiredKeyedService<OpenAIClient>("openai") : 128var client2 = host.Services.GetRequiredKeyedService<OpenAIClient>("openai2"); 129var client3 = host.Services.GetRequiredKeyedService<OpenAIClient>("openai3");
Aspire.Qdrant.Client.Tests (2)
ConformanceTests.cs (2)
91var client2 = host.Services.GetRequiredKeyedService<QdrantClient>("qdrant2"); 92var client3 = host.Services.GetRequiredKeyedService<QdrantClient>("qdrant3");
Aspire.RabbitMQ.Client (2)
AspireRabbitMQExtensions.cs (2)
120builder.Services.AddKeyedSingleton<IConnection>(serviceKey, (sp, key) => CreateConnection(sp.GetRequiredKeyedService<IConnectionFactory>(key), settings.MaxConnectRetryCount)); 143options.Connection = serviceKey is null ? sp.GetRequiredService<IConnection>() : sp.GetRequiredKeyedService<IConnection>(serviceKey);
Aspire.RabbitMQ.Client.Tests (5)
AspireRabbitMQExtensionsTests.cs (5)
47host.Services.GetRequiredKeyedService<IConnection>("messaging") : 76host.Services.GetRequiredKeyedService<IConnection>("messaging") : 107host.Services.GetRequiredKeyedService<IConnection>("messaging") : 183var connection2 = host.Services.GetRequiredKeyedService<IConnection>("messaging2"); 184var connection3 = host.Services.GetRequiredKeyedService<IConnection>("messaging3");
Aspire.StackExchange.Redis (1)
AspireRedisExtensions.cs (1)
137connectionMultiplexerFactory: sp => serviceKey is null ? sp.GetRequiredService<IConnectionMultiplexer>() : sp.GetRequiredKeyedService<IConnectionMultiplexer>(serviceKey),
Aspire.StackExchange.Redis.DistributedCaching (1)
AspireRedisDistributedCacheExtensions.cs (1)
59options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredKeyedService<IConnectionMultiplexer>(name));
Aspire.StackExchange.Redis.OutputCaching (1)
AspireRedisOutputCacheExtensions.cs (1)
58options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredKeyedService<IConnectionMultiplexer>(name));
Aspire.StackExchange.Redis.Tests (8)
AspireRedisExtensionsTests.cs (8)
76host.Services.GetRequiredKeyedService<IConnectionMultiplexer>("myredis") : 105host.Services.GetRequiredKeyedService<IConnectionMultiplexer>("redis") : 138host.Services.GetRequiredKeyedService<IConnectionMultiplexer>("redis") : 256var connectionMultiplexer = host.Services.GetRequiredKeyedService<IConnectionMultiplexer>("redis"); 320var connection2 = host.Services.GetRequiredKeyedService<IConnectionMultiplexer>("redis2"); 321var connection3 = host.Services.GetRequiredKeyedService<IConnectionMultiplexer>("redis3"); 357var connection2 = host.Services.GetRequiredKeyedService<IConnectionMultiplexer>("redis2"); 359var connection3 = host.Services.GetRequiredKeyedService<IConnectionMultiplexer>("redis3");
Microsoft.Extensions.DependencyInjection.Abstractions (1)
ServiceProviderKeyedServiceExtensions.cs (1)
101return provider.GetRequiredKeyedService<IEnumerable<T>>(serviceKey);
Microsoft.Extensions.Http.Diagnostics (2)
Logging\HttpClientLoggingHttpClientBuilderExtensions.cs (1)
99serviceProvider => serviceProvider.GetRequiredKeyedService<HttpClientLogger>(builder.Name),
Logging\Internal\ServiceProviderExtensions.cs (1)
24: provider.GetRequiredKeyedService<T>(serviceKey);