2 implementations of GetConnectionStringAsync
Aspire.Hosting.PostgreSQL (1)
PostgresServerResource.cs (1)
77public ValueTask<string?> GetConnectionStringAsync(CancellationToken cancellationToken = default)
Aspire.Hosting.SqlServer (1)
SqlServerServerResource.cs (1)
61public ValueTask<string?> GetConnectionStringAsync(CancellationToken cancellationToken = default)
53 references to GetConnectionStringAsync
Aspire.Hosting (2)
ApplicationModel\IResourceWithConnectionString.cs (1)
21ValueTask<string?> IValueProvider.GetValueAsync(CancellationToken cancellationToken) => GetConnectionStringAsync(cancellationToken);
ResourceBuilderExtensions.cs (1)
330/// underlying connection string value can be retrieved using <see cref="IResourceWithConnectionString.GetConnectionStringAsync(CancellationToken)"/>.
Aspire.Hosting.Azure.Tests (26)
AzureBicepResourceTests.cs (25)
237Assert.Equal(cs, await ((IResourceWithConnectionString)cosmos.Resource).GetConnectionStringAsync()); 331Assert.Equal("mycosmosconnectionstring", await connectionStringResource.GetConnectionStringAsync()); 425Assert.Equal("mycosmosconnectionstring", await connectionStringResource.GetConnectionStringAsync()); 441Assert.Equal("https://myendpoint", await connectionStringResource.GetConnectionStringAsync()); 506Assert.Equal("myinstrumentationkey", await connectionStringResource.GetConnectionStringAsync()); 563Assert.Equal("myinstrumentationkey", await connectionStringResource.GetConnectionStringAsync()); 629Assert.Equal("myinstrumentationkey", await connectionStringResource.GetConnectionStringAsync()); 1619Assert.Equal("mynamespaceEndpoint", await connectionStringResource.GetConnectionStringAsync()); 1723Assert.Equal("https://mywebpubsubendpoint", await connectionStringResource.GetConnectionStringAsync()); 1868Assert.Equal(Resolve(blobqs, "blob", 10000), await ((IResourceWithConnectionString)blob.Resource).GetConnectionStringAsync()); 1869Assert.Equal(Resolve(queueqs, "queue", 10001), await ((IResourceWithConnectionString)queue.Resource).GetConnectionStringAsync()); 1870Assert.Equal(Resolve(tableqs, "table", 10002), await ((IResourceWithConnectionString)table.Resource).GetConnectionStringAsync()); 1990Assert.Equal("https://myblob", await connectionStringBlobResource.GetConnectionStringAsync()); 2005Assert.Equal("https://myqueue", await connectionStringQueueResource.GetConnectionStringAsync()); 2020Assert.Equal("https://mytable", await connectionStringTableResource.GetConnectionStringAsync()); 2149Assert.Equal("https://myblob", await connectionStringBlobResource.GetConnectionStringAsync()); 2164Assert.Equal("https://myqueue", await connectionStringQueueResource.GetConnectionStringAsync()); 2179Assert.Equal("https://mytable", await connectionStringTableResource.GetConnectionStringAsync()); 2307Assert.Equal("https://myblob", await connectionStringBlobResource.GetConnectionStringAsync()); 2322Assert.Equal("https://myqueue", await connectionStringQueueResource.GetConnectionStringAsync()); 2337Assert.Equal("https://mytable", await connectionStringTableResource.GetConnectionStringAsync()); 2466Assert.Equal("https://myblob", await connectionStringBlobResource.GetConnectionStringAsync()); 2481Assert.Equal("https://myqueue", await connectionStringQueueResource.GetConnectionStringAsync()); 2496Assert.Equal("https://mytable", await connectionStringTableResource.GetConnectionStringAsync()); 2530Assert.Equal(fakeConnectionString, await connectionStringResource.GetConnectionStringAsync());
AzureWebPubSubExtensionsTests.cs (1)
394Assert.Equal("https://mywebpubsubendpoint", await connectionStringResource.GetConnectionStringAsync());
Aspire.Hosting.Elasticsearch.Tests (1)
AddElasticsearchTests.cs (1)
150var connectionString = await connectionStringResource.GetConnectionStringAsync();
Aspire.Hosting.Garnet.Tests (1)
AddGarnetTests.cs (1)
82var connectionString = await connectionStringResource.GetConnectionStringAsync(default);
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
68var connectionString = await connectionStringResource.GetConnectionStringAsync();
Aspire.Hosting.Milvus.Tests (1)
AddMilvusTests.cs (1)
91var connectionString = await connectionStringResource.GetConnectionStringAsync();
Aspire.Hosting.MongoDB.Tests (2)
AddMongoDBTests.cs (2)
89var connectionString = await connectionStringResource.GetConnectionStringAsync(); 91Assert.Equal($"mongodb://admin:{dbResource.Parent.PasswordParameter?.Value}@localhost:27017?authSource=admin&authMechanism=SCRAM-SHA-256", await serverResource.GetConnectionStringAsync());
Aspire.Hosting.MySql.Tests (3)
AddMySqlTests.cs (3)
125var connectionString = await connectionStringResource.GetConnectionStringAsync(); 145var mySqlConnectionString = await mySqlConnectionStringResource.GetConnectionStringAsync(); 148var dbConnectionString = await mySqlDatabaseConnectionStringResource.GetConnectionStringAsync();
Aspire.Hosting.Nats.Tests (2)
AddNatsTests.cs (2)
52var connectionString = await connectionStringResource.GetConnectionStringAsync(); 79var connectionString = await connectionStringResource.GetConnectionStringAsync();
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
124var connectionString = await connectionStringResource.GetConnectionStringAsync(default); 145var oracleConnectionString = oracleConnectionStringResource.GetConnectionStringAsync(); 148var dbConnectionString = await oracleDatabaseConnectionStringResource.GetConnectionStringAsync();
Aspire.Hosting.PostgreSQL (1)
PostgresServerResource.cs (1)
81return connectionStringAnnotation.Resource.GetConnectionStringAsync(cancellationToken);
Aspire.Hosting.PostgreSQL.Tests (2)
AddPostgresTests.cs (2)
161var connectionString = await connectionStringResource.GetConnectionStringAsync(); 182var dbConnectionString = await postgresDatabaseConnectionStringResource.GetConnectionStringAsync();
Aspire.Hosting.Qdrant.Tests (1)
AddQdrantTests.cs (1)
163var connectionString = await connectionStringResource.GetConnectionStringAsync();
Aspire.Hosting.RabbitMQ.Tests (1)
AddRabbitMQTests.cs (1)
108var connectionString = await connectionStringResource.GetConnectionStringAsync(default);
Aspire.Hosting.Redis (1)
RedisResource.cs (1)
50return connectionStringAnnotation.Resource.GetConnectionStringAsync(cancellationToken);
Aspire.Hosting.Redis.Tests (1)
AddRedisTests.cs (1)
91var connectionString = await connectionStringResource.GetConnectionStringAsync(default);
Aspire.Hosting.SqlServer (1)
SqlServerServerResource.cs (1)
65return connectionStringAnnotation.Resource.GetConnectionStringAsync(cancellationToken);
Aspire.Hosting.SqlServer.Tests (1)
AddSqlServerTests.cs (1)
119var connectionString = await connectionStringResource.GetConnectionStringAsync();
Aspire.Hosting.Testing (1)
DistributedApplicationHostingTestingExtensions.cs (1)
49return resourceWithConnectionString.GetConnectionStringAsync(cancellationToken);
Aspire.Hosting.Valkey.Tests (1)
AddValkeyTests.cs (1)
82var connectionString = await connectionStringResource.GetConnectionStringAsync(default);