12 implementations of IResourceWithConnectionString
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
11public class AzureSqlServerResource : AzureProvisioningResource, IResourceWithConnectionString
Aspire.Hosting.Elasticsearch (1)
ElasticsearchResource.cs (1)
9public class ElasticsearchResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.Milvus (1)
MilvusServerResource.cs (1)
11public class MilvusServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.MongoDB (1)
MongoDBDatabaseResource.cs (1)
9public class MongoDBDatabaseResource : Resource, IResourceWithParent<MongoDBServerResource>, IResourceWithConnectionString
Aspire.Hosting.MySql (1)
MySqlServerResource.cs (1)
9public class MySqlServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.Oracle (1)
OracleDatabaseServerResource.cs (1)
9public class OracleDatabaseServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.PostgreSQL (1)
PostgresServerResource.cs (1)
12public class PostgresServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.Qdrant (1)
QdrantServerResource.cs (1)
9public class QdrantServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.RabbitMQ (1)
RabbitMQServerResource.cs (1)
9public class RabbitMQServerResource : ContainerResource, IResourceWithConnectionString, IResourceWithEnvironment
Aspire.Hosting.SqlServer (2)
SqlServerDatabaseResource.cs (1)
9public class SqlServerDatabaseResource : Resource, IResourceWithParent<SqlServerServerResource>, IResourceWithConnectionString
SqlServerServerResource.cs (1)
9public class SqlServerServerResource : ContainerResource, IResourceWithConnectionString
Aspire.Hosting.Tests (1)
ExpressionResolverTests.cs (1)
121sealed class TestExpressionResolverResource : ContainerResource, IResourceWithEndpoints, IResourceWithConnectionString
169 references to IResourceWithConnectionString
Aspire.Hosting (24)
ApplicationModel\ConnectionStringRedirectAnnotation.cs (3)
7/// Links to a resource that implements <see cref="IResourceWithConnectionString"/> that can be used by the containing resource to acquire a connection string. 10public class ConnectionStringRedirectAnnotation(IResourceWithConnectionString resource) : IResourceAnnotation 15public IResourceWithConnectionString Resource { get; } = resource ?? throw new ArgumentNullException(nameof(resource));
ApplicationModel\ConnectionStringReference.cs (2)
8public class ConnectionStringReference(IResourceWithConnectionString resource, bool optional) : IManifestExpressionProvider, IValueProvider, IValueWithReferences 13public IResourceWithConnectionString Resource { get; } = resource ?? throw new ArgumentNullException(nameof(resource));
ApplicationModel\ExpressionResolver.cs (1)
143IResourceWithConnectionString cs => await ResolveInternalAsync(cs.ConnectionStringExpression).ConfigureAwait(false),
ApplicationModel\ResourceWithConnectionStringSurrogate.cs (1)
6internal sealed class ResourceWithConnectionStringSurrogate(ParameterResource innerResource, string? environmentVariableName) : IResourceWithConnectionString
Dcp\ApplicationExecutor.cs (2)
1271if (resource is IResourceWithConnectionString) 1281foreach (var child in children.OfType<IResourceWithConnectionString>())
IDistributedApplicationBuilder.cs (2)
188/// is <see cref="IResourceBuilder{IResourceWithConnectionString}"/>. The <see cref="ParameterResource"/> type does not implement the <see cref="IResourceWithConnectionString"/>. 192/// parameter resource in a "surrogate" class which proxies access to the <see cref="ParameterResource"/> fields but implements <see cref="IResourceWithConnectionString"/>. The
ParameterResourceBuilderExtensions.cs (4)
210/// Adds a parameter to the distributed application but wrapped in a resource with a connection string for use with <see cref="ResourceBuilderExtensions.WithReference{TDestination}(IResourceBuilder{TDestination}, IResourceBuilder{IResourceWithConnectionString}, string?, bool)"/> 217public static IResourceBuilder<IResourceWithConnectionString> AddConnectionString(this IDistributedApplicationBuilder builder, [ResourceName] string name, string? environmentVariableName = null) 240where T : ContainerResource, IResourceWithConnectionString 252public static void ConfigureConnectionStringManifestPublisher(IResourceBuilder<IResourceWithConnectionString> builder)
Publishing\ManifestPublishingContext.cs (3)
111else if (resource is IResourceWithConnectionString resourceWithConnectionString) 138private Task WriteConnectionStringAsync(IResourceWithConnectionString resource) 378if (resource is IResourceWithConnectionString resourceWithConnectionString &&
ResourceBuilderExtensions.cs (6)
178IResourceBuilder<IResourceWithConnectionString> resource) 294public static IResourceBuilder<T> WithConnectionStringRedirection<T>(this IResourceBuilder<T> builder, IResourceWithConnectionString resource) where T : IResourceWithConnectionString 329/// underlying connection string value can be retrieved using <see cref="IResourceWithConnectionString.GetConnectionStringAsync(CancellationToken)"/>. 343public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, IResourceBuilder<IResourceWithConnectionString> source, string? connectionName = null, bool optional = false) 349var resource = source.Resource;
Aspire.Hosting.Azure (4)
AzureBicepResourceExtensions.cs (1)
222public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<IResourceWithConnectionString> value)
AzureResourceExtensions.cs (2)
21where T : IAzureResource, IResourceWithConnectionString 23ParameterResourceBuilderExtensions.ConfigureConnectionStringManifestPublisher((IResourceBuilder<IResourceWithConnectionString>)builder);
Provisioning\Provisioners\AzureProvisioner.cs (1)
351foreach (var child in children.OfType<IResourceWithConnectionString>())
Aspire.Hosting.Azure.AppConfiguration (1)
AzureAppConfigurationResource.cs (1)
15IResourceWithConnectionString
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
641if (value is IResourceWithConnectionString csrs)
Aspire.Hosting.Azure.ApplicationInsights (2)
AzureApplicationInsightsResource.cs (2)
15IResourceWithConnectionString 29string IResourceWithConnectionString.ConnectionStringEnvironmentVariable => "APPLICATIONINSIGHTS_CONNECTION_STRING";
Aspire.Hosting.Azure.CognitiveServices (1)
AzureOpenAIResource.cs (1)
14IResourceWithConnectionString
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBResource.cs (1)
14IResourceWithConnectionString,
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsResource.cs (1)
15IResourceWithConnectionString,
Aspire.Hosting.Azure.Functions (1)
AzureFunctionsProjectResourceExtensions.cs (1)
205where TSource : IResourceWithConnectionString, IResourceWithAzureFunctionsConfig
Aspire.Hosting.Azure.KeyVault (1)
AzureKeyVaultResource.cs (1)
13public class AzureKeyVaultResource(string name, Action<AzureResourceInfrastructure> configureInfrastructure) : AzureProvisioningResource(name, configureInfrastructure), IResourceWithConnectionString
Aspire.Hosting.Azure.PostgreSQL (3)
AzurePostgresFlexibleServerDatabaseResource.cs (1)
17: Resource(ThrowIfNull(name)), IResourceWithParent<AzurePostgresFlexibleServerResource>, IResourceWithConnectionString
AzurePostgresFlexibleServerResource.cs (1)
16IResourceWithConnectionString
AzurePostgresResource.cs (1)
16IResourceWithConnectionString
Aspire.Hosting.Azure.Redis (2)
AzureRedisCacheResource.cs (1)
16IResourceWithConnectionString
AzureRedisResource.cs (1)
16IResourceWithConnectionString
Aspire.Hosting.Azure.Search (1)
AzureSearchResource.cs (1)
15IResourceWithConnectionString
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusResource.cs (1)
14: AzureProvisioningResource(name, configureInfrastructure), IResourceWithConnectionString, IResourceWithAzureFunctionsConfig
Aspire.Hosting.Azure.SignalR (1)
AzureSignalRResource.cs (1)
15IResourceWithConnectionString
Aspire.Hosting.Azure.Sql (1)
AzureSqlDatabaseResource.cs (1)
17: Resource(ThrowIfNull(name)), IResourceWithParent<AzureSqlServerResource>, IResourceWithConnectionString
Aspire.Hosting.Azure.Storage (3)
AzureBlobStorageResource.cs (1)
14IResourceWithConnectionString,
AzureQueueStorageResource.cs (1)
14IResourceWithConnectionString,
AzureTableStorageResource.cs (1)
14IResourceWithConnectionString,
Aspire.Hosting.Azure.Tests (49)
AzureBicepProvisionerTests.cs (1)
190IResourceWithConnectionString
AzureBicepResourceTests.cs (46)
237Assert.Equal(cs, await ((IResourceWithConnectionString)cosmos.Resource).GetConnectionStringAsync()); 328var connectionStringResource = (IResourceWithConnectionString)cosmos.Resource; 422var connectionStringResource = (IResourceWithConnectionString)cosmos.Resource; 439var connectionStringResource = (IResourceWithConnectionString)appConfig.Resource; 503var connectionStringResource = (IResourceWithConnectionString)appInsights.Resource; 560var connectionStringResource = (IResourceWithConnectionString)appInsights.Resource; 626var connectionStringResource = (IResourceWithConnectionString)appInsights.Resource; 1616var connectionStringResource = (IResourceWithConnectionString)serviceBus.Resource; 1721var connectionStringResource = (IResourceWithConnectionString)wps.Resource; 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()); 1988var connectionStringBlobResource = (IResourceWithConnectionString)blob.Resource; 2003var connectionStringQueueResource = (IResourceWithConnectionString)queue.Resource; 2018var connectionStringTableResource = (IResourceWithConnectionString)table.Resource; 2147var connectionStringBlobResource = (IResourceWithConnectionString)blob.Resource; 2162var connectionStringQueueResource = (IResourceWithConnectionString)queue.Resource; 2177var connectionStringTableResource = (IResourceWithConnectionString)table.Resource; 2305var connectionStringBlobResource = (IResourceWithConnectionString)blob.Resource; 2320var connectionStringQueueResource = (IResourceWithConnectionString)queue.Resource; 2335var connectionStringTableResource = (IResourceWithConnectionString)table.Resource; 2464var connectionStringBlobResource = (IResourceWithConnectionString)blob.Resource; 2479var connectionStringQueueResource = (IResourceWithConnectionString)queue.Resource; 2494var connectionStringTableResource = (IResourceWithConnectionString)table.Resource; 2525var connectionStringResource = (IResourceWithConnectionString)search.Resource;
AzureWebPubSubExtensionsTests.cs (2)
392var connectionStringResource = (IResourceWithConnectionString)wps.Resource;
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubResource.cs (1)
15IResourceWithConnectionString
Aspire.Hosting.Containers.Tests (1)
ContainerResourceTests.cs (1)
278private sealed class TestResource(string name, string connectionString) : Resource(name), IResourceWithConnectionString
Aspire.Hosting.Elasticsearch.Tests (2)
AddElasticsearchTests.cs (2)
149var connectionStringResource = Assert.Single(appModel.Resources.OfType<ElasticsearchResource>()) as IResourceWithConnectionString;
Aspire.Hosting.Garnet (1)
GarnetResource.cs (1)
13public class GarnetResource(string name) : ContainerResource(ThrowIfNull(name)), IResourceWithConnectionString
Aspire.Hosting.Garnet.Tests (2)
AddGarnetTests.cs (2)
81var connectionStringResource = Assert.Single(appModel.Resources.OfType<IResourceWithConnectionString>());
Aspire.Hosting.Kafka (1)
KafkaServerResource.cs (1)
12public class KafkaServerResource(string name) : ContainerResource(name), IResourceWithConnectionString, IResourceWithEnvironment
Aspire.Hosting.Kafka.Tests (2)
AddKafkaTests.cs (2)
67var connectionStringResource = Assert.Single(appModel.Resources.OfType<KafkaServerResource>()) as IResourceWithConnectionString;
Aspire.Hosting.Milvus (1)
MilvusDatabaseResource.cs (1)
14public class MilvusDatabaseResource(string name, string databaseName, MilvusServerResource parent) : Resource(name), IResourceWithParent<MilvusServerResource>, IResourceWithConnectionString
Aspire.Hosting.Milvus.Tests (2)
AddMilvusTests.cs (2)
89var connectionStringResource = milvus.Resource as IResourceWithConnectionString;
Aspire.Hosting.MongoDB (1)
MongoDBServerResource.cs (1)
10public class MongoDBServerResource(string name) : ContainerResource(name), IResourceWithConnectionString
Aspire.Hosting.MongoDB.Tests (4)
AddMongoDBTests.cs (4)
86var serverResource = dbResource.Parent as IResourceWithConnectionString; 87var connectionStringResource = dbResource as IResourceWithConnectionString;
Aspire.Hosting.MySql (1)
MySqlDatabaseResource.cs (1)
12public class MySqlDatabaseResource(string name, string databaseName, MySqlServerResource parent) : Resource(name), IResourceWithParent<MySqlServerResource>, IResourceWithConnectionString
Aspire.Hosting.MySql.Tests (6)
AddMySqlTests.cs (6)
124var connectionStringResource = Assert.Single(appModel.Resources.OfType<IResourceWithConnectionString>()); 144var mySqlConnectionStringResource = (IResourceWithConnectionString)mySqlResource; 147var mySqlDatabaseConnectionStringResource = (IResourceWithConnectionString)mySqlDatabaseResource;
Aspire.Hosting.Nats (1)
NatsServerResource.cs (1)
13public class NatsServerResource(string name) : ContainerResource(ThrowIfNull(name)), IResourceWithConnectionString
Aspire.Hosting.Nats.Tests (4)
AddNatsTests.cs (4)
50var connectionStringResource = natsResource as IResourceWithConnectionString; 78var connectionStringResource = Assert.Single(appModel.Resources.OfType<NatsServerResource>()) as IResourceWithConnectionString;
Aspire.Hosting.Oracle (1)
OracleDatabaseResource.cs (1)
12public class OracleDatabaseResource(string name, string databaseName, OracleDatabaseServerResource parent) : Resource(name), IResourceWithParent<OracleDatabaseServerResource>, IResourceWithConnectionString
Aspire.Hosting.Oracle.Tests (6)
AddOracleTests.cs (6)
123var connectionStringResource = Assert.Single(appModel.Resources.OfType<IResourceWithConnectionString>()); 144var oracleConnectionStringResource = (IResourceWithConnectionString)oracleResource; 147var oracleDatabaseConnectionStringResource = (IResourceWithConnectionString)oracleDatabaseResource;
Aspire.Hosting.Orleans (10)
OrleansServiceExtensions.cs (8)
95IResourceBuilder<IResourceWithConnectionString> provider) 130IResourceBuilder<IResourceWithConnectionString> provider) 143IResourceBuilder<IResourceWithConnectionString> provider) 182IResourceBuilder<IResourceWithConnectionString> provider) 195IResourceBuilder<IResourceWithConnectionString> provider) 260IResourceBuilder<IResourceWithConnectionString> provider) 298IResourceBuilder<IResourceWithConnectionString> provider) 311IResourceBuilder<IResourceWithConnectionString> provider)
ProviderConfiguration.cs (2)
11internal sealed class ProviderConfiguration(string providerType, string? serviceKey = null, IResourceBuilder<IResourceWithConnectionString>? resource = null) : IProviderConfiguration 18internal static ProviderConfiguration Create(IResourceBuilder<IResourceWithConnectionString> resourceBuilder)
Aspire.Hosting.PostgreSQL (1)
PostgresDatabaseResource.cs (1)
15public class PostgresDatabaseResource(string name, string databaseName, PostgresServerResource postgresParentResource) : Resource(ThrowIfNull(name)), IResourceWithParent<PostgresServerResource>, IResourceWithConnectionString
Aspire.Hosting.PostgreSQL.Tests (4)
AddPostgresTests.cs (4)
159var connectionStringResource = postgres.Resource as IResourceWithConnectionString; 181var postgresDatabaseConnectionStringResource = (IResourceWithConnectionString)postgresDatabaseResource;
Aspire.Hosting.Qdrant.Tests (2)
AddQdrantTests.cs (2)
161var connectionStringResource = qdrant.Resource as IResourceWithConnectionString;
Aspire.Hosting.RabbitMQ.Tests (2)
AddRabbitMQTests.cs (2)
107var connectionStringResource = rabbitMqResource as IResourceWithConnectionString;
Aspire.Hosting.Redis (1)
RedisResource.cs (1)
10public class RedisResource(string name) : ContainerResource(name), IResourceWithConnectionString
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
90var connectionStringResource = Assert.Single(appModel.Resources.OfType<IResourceWithConnectionString>());
Aspire.Hosting.Seq (1)
SeqResource.cs (1)
10public class SeqResource(string name) : ContainerResource(name), IResourceWithConnectionString
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
118var connectionStringResource = (IResourceWithConnectionString)sqlResource;
Aspire.Hosting.Testing (1)
DistributedApplicationHostingTestingExtensions.cs (1)
44if (resource is not IResourceWithConnectionString resourceWithConnectionString)
Aspire.Hosting.Tests (5)
ExecutableResourceTests.cs (1)
74private sealed class TestResource(string name, string connectionString) : Resource(name), IResourceWithConnectionString
ResourceNotificationTests.cs (1)
386IResourceWithConnectionString,
WaitForTests.cs (1)
366private sealed class CustomResource(string name) : Resource(name), IResourceWithConnectionString, IResourceWithWaitSupport
WithEnvironmentTests.cs (1)
266private sealed class TestResource(string name, string connectionString) : Resource(name), IResourceWithConnectionString
WithReferenceTests.cs (1)
303private sealed class TestResource(string name) : Resource(name), IResourceWithConnectionString
Aspire.Hosting.Valkey (1)
ValkeyResource.cs (1)
10public class ValkeyResource(string name) : ContainerResource(name), IResourceWithConnectionString
Aspire.Hosting.Valkey.Tests (2)
AddValkeyTests.cs (2)
81var connectionStringResource = Assert.Single(appModel.Resources.OfType<IResourceWithConnectionString>());