1 instantiation of ReferenceExpression
Aspire.Hosting (1)
ApplicationModel\ReferenceExpression.cs (1)
74return new(format, valueProviders, manifestExpressions);
187 references to ReferenceExpression
Aspire.Hosting (14)
ApplicationModel\ExpressionResolver.cs (2)
80async Task<string?> EvalExpressionAsync(ReferenceExpression expr) 144ReferenceExpression ex => await EvalExpressionAsync(ex).ConfigureAwait(false),
ApplicationModel\IResourceWithConnectionString.cs (1)
26public ReferenceExpression ConnectionStringExpression { get; }
ApplicationModel\ReferenceExpression.cs (5)
72internal static ReferenceExpression Create(string format, IValueProvider[] valueProviders, string[] manifestExpressions) 78/// Creates a new instance of <see cref="ReferenceExpression"/> with the specified format and value providers. 81/// <returns>A new instance of <see cref="ReferenceExpression"/> with the specified format and value providers.</returns> 82public static ReferenceExpression Create(in ExpressionInterpolatedStringHandler handler) 134internal readonly ReferenceExpression GetExpression() =>
ApplicationModel\ResourceWithConnectionStringSurrogate.cs (2)
14public ReferenceExpression ConnectionStringExpression => 15ReferenceExpression.Create($"{innerResource}");
ProjectResourceBuilderExtensions.cs (2)
756var url = ReferenceExpression.Create($"{e.EndpointAnnotation.UriScheme}://{host}:{e.Property(EndpointProperty.TargetPort)}");
ResourceBuilderExtensions.cs (2)
46public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, in ReferenceExpression.ExpressionInterpolatedStringHandler value) 68public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, ReferenceExpression value)
Aspire.Hosting.Azure (3)
AzureBicepResourceExtensions.cs (1)
254public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, ReferenceExpression value)
AzureProvisioningResourceExtensions.cs (2)
139/// The <see cref="ReferenceExpression"/> that represents the value to use for the <see cref="ProvisioningParameter"/>. 149public static ProvisioningParameter AsProvisioningParameter(this ReferenceExpression expression, AzureResourceInfrastructure infrastructure, string parameterName)
Aspire.Hosting.Azure.AppConfiguration (2)
AzureAppConfigurationResource.cs (2)
25public ReferenceExpression ConnectionStringExpression => 26ReferenceExpression.Create($"{Endpoint}");
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
681if (value is ReferenceExpression expr)
Aspire.Hosting.Azure.ApplicationInsights (2)
AzureApplicationInsightsResource.cs (2)
25public ReferenceExpression ConnectionStringExpression => 26ReferenceExpression.Create($"{ConnectionString}");
Aspire.Hosting.Azure.CognitiveServices (2)
AzureOpenAIResource.cs (2)
26public ReferenceExpression ConnectionStringExpression => 27ReferenceExpression.Create($"{ConnectionString}");
Aspire.Hosting.Azure.CosmosDB (4)
AzureCosmosDBEmulatorConnectionString.cs (2)
11public static ReferenceExpression Create(EndpointReference endpoint) => ReferenceExpression.Create($"AccountKey={CosmosConstants.EmulatorAccountKey};AccountEndpoint=https://{endpoint.Property(EndpointProperty.IPV4Host)}:{endpoint.Property(EndpointProperty.Port)};DisableServerCertificateValidation=True;");
AzureCosmosDBResource.cs (2)
34public ReferenceExpression ConnectionStringExpression => 37: ReferenceExpression.Create($"{ConnectionString}");
Aspire.Hosting.Azure.EventHubs (3)
AzureEventHubsResource.cs (3)
47public ReferenceExpression ConnectionStringExpression => 49? ReferenceExpression.Create($"Endpoint=sb://{EmulatorEndpoint.Property(EndpointProperty.Host)}:{EmulatorEndpoint.Property(EndpointProperty.Port)};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;") 50: ReferenceExpression.Create($"{EventHubsEndpoint}");
Aspire.Hosting.Azure.Functions (1)
AzureFunctionsProjectResourceExtensions.cs (1)
111context.EnvironmentVariables["ASPNETCORE_URLS"] = ReferenceExpression.Create($"http://+:{endpoint.Property(EndpointProperty.TargetPort)}");
Aspire.Hosting.Azure.KeyVault (2)
AzureKeyVaultResource.cs (2)
23public ReferenceExpression ConnectionStringExpression => 24ReferenceExpression.Create($"{VaultUri}");
Aspire.Hosting.Azure.PostgreSQL (9)
AzurePostgresFlexibleServerDatabaseResource.cs (1)
27public ReferenceExpression ConnectionStringExpression => Parent.GetDatabaseConnectionString(Name, databaseName);
AzurePostgresFlexibleServerResource.cs (6)
60public ReferenceExpression ConnectionStringExpression => 63ReferenceExpression.Create($"{ConnectionStringSecretOutput}") : 64ReferenceExpression.Create($"{ConnectionStringOutput}")); 87internal ReferenceExpression GetDatabaseConnectionString(string databaseResourceName, string databaseName) 93return ReferenceExpression.Create($"{new BicepSecretOutputReference(GetDatabaseKeyVaultSecretName(databaseResourceName), this)}"); 96return ReferenceExpression.Create($"{this};Database={databaseName}");
AzurePostgresResource.cs (2)
26public ReferenceExpression ConnectionStringExpression => 27ReferenceExpression.Create($"{ConnectionString}");
Aspire.Hosting.Azure.Redis (5)
AzureRedisCacheResource.cs (3)
48public ReferenceExpression ConnectionStringExpression => 51ReferenceExpression.Create($"{ConnectionStringSecretOutput}") : 52ReferenceExpression.Create($"{ConnectionStringOutput}"));
AzureRedisResource.cs (2)
26public ReferenceExpression ConnectionStringExpression => 27ReferenceExpression.Create($"{ConnectionString}");
Aspire.Hosting.Azure.Search (2)
AzureSearchResource.cs (2)
28public ReferenceExpression ConnectionStringExpression => 29ReferenceExpression.Create($"{ConnectionString}");
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusResource.cs (2)
28public ReferenceExpression ConnectionStringExpression => 29ReferenceExpression.Create($"{ServiceBusEndpoint}");
Aspire.Hosting.Azure.SignalR (2)
AzureSignalRResource.cs (2)
25public ReferenceExpression ConnectionStringExpression => 26ReferenceExpression.Create($"Endpoint=https://{HostName};AuthType=azure");
Aspire.Hosting.Azure.Sql (5)
AzureSqlDatabaseResource.cs (2)
27public ReferenceExpression ConnectionStringExpression => 28ReferenceExpression.Create($"{Parent};Database={DatabaseName}");
AzureSqlServerResource.cs (3)
45public ReferenceExpression ConnectionStringExpression 52ReferenceExpression? result = null; 59ReferenceExpression.Create($"Server=tcp:{FullyQualifiedDomainName},1433;Encrypt=True;Authentication=\"Active Directory Default\"");
Aspire.Hosting.Azure.Storage (11)
AzureBlobStorageResource.cs (1)
26public ReferenceExpression ConnectionStringExpression =>
AzureQueueStorageResource.cs (1)
26public ReferenceExpression ConnectionStringExpression =>
AzureStorageEmulatorConnectionString.cs (1)
18public static ReferenceExpression Create(EndpointReference? blobEndpoint = null, EndpointReference? queueEndpoint = null, EndpointReference? tableEndpoint = null)
AzureStorageResource.cs (7)
49internal ReferenceExpression GetEmulatorConnectionString() => IsEmulator 53internal ReferenceExpression GetTableConnectionString() => IsEmulator 55: ReferenceExpression.Create($"{TableEndpoint}"); 57internal ReferenceExpression GetQueueConnectionString() => IsEmulator 59: ReferenceExpression.Create($"{QueueEndpoint}"); 61internal ReferenceExpression GetBlobConnectionString() => IsEmulator 63: ReferenceExpression.Create($"{BlobEndpoint}");
AzureTableStorageResource.cs (1)
25public ReferenceExpression ConnectionStringExpression =>
Aspire.Hosting.Azure.Tests (13)
AzureBicepProvisionerTests.cs (3)
56.WithParameter("expr", ReferenceExpression.Create($"{param.Resource}/1")) 192public ReferenceExpression ConnectionStringExpression => 193ReferenceExpression.Create($"{connectionString}");
AzureBicepResourceTests.cs (1)
231var csExpr = cosmos.Resource.ConnectionStringExpression;
AzureContainerAppsTests.cs (6)
1117var secret0 = ReferenceExpression.Create($"{connectionString}"); 1118var secret1 = ReferenceExpression.Create($"{secret0}"); 1126var complex = ReferenceExpression.Create($"a/{connectionString}/{secret0}/{connectionString1}");
AzureProvisioningResourceExtensionsTests.cs (2)
23var referenceExpression = ReferenceExpression.Create($"prefix:{endpointReference.Property(EndpointProperty.Host)}:{endpointReference.Property(EndpointProperty.Port)}");
src\Aspire.Hosting.Azure.Storage\AzureStorageEmulatorConnectionString.cs (1)
18public static ReferenceExpression Create(EndpointReference? blobEndpoint = null, EndpointReference? queueEndpoint = null, EndpointReference? tableEndpoint = null)
Aspire.Hosting.Azure.WebPubSub (7)
AzureWebPubSubExtensions.cs (4)
147ReferenceExpression.ExpressionInterpolatedStringHandler urlTemplateExpression, string userEventPattern = "*", string[]? systemEvents = null, UpstreamAuthSettings? authSettings = null) 149var urlExpression = ReferenceExpression.Create(urlTemplateExpression); 166ReferenceExpression urlExpression, string userEventPattern = "*", string[]? systemEvents = null, UpstreamAuthSettings? authSettings = null)
AzureWebPubSubHubResource.cs (1)
21internal List<(ReferenceExpression url, string userEvents, string[]? systemEvents, UpstreamAuthSettings? auth)> EventHandlers { get; } = new();
AzureWebPubSubResource.cs (2)
27public ReferenceExpression ConnectionStringExpression => ReferenceExpression.Create($"{Endpoint}");
Aspire.Hosting.Containers.Tests (2)
ContainerResourceTests.cs (2)
280public ReferenceExpression ConnectionStringExpression => 281ReferenceExpression.Create($"{connectionString}");
Aspire.Hosting.Elasticsearch (2)
ElasticsearchResource.cs (2)
54public ReferenceExpression ConnectionStringExpression => 55ReferenceExpression.Create($"http://{UserName}:{PasswordParameter}@{PrimaryEndpoint.Property(EndpointProperty.Host)}:{PrimaryEndpoint.Property(EndpointProperty.Port)}");
Aspire.Hosting.Garnet (2)
GarnetResource.cs (2)
27public ReferenceExpression ConnectionStringExpression => 28ReferenceExpression.Create(
Aspire.Hosting.Kafka (7)
KafkaBuilderExtensions.cs (5)
140var bootstrapServers = context.ExecutionContext.IsRunMode 143? ReferenceExpression.Create($"{endpoint.Resource.Name}:{endpoint.Property(EndpointProperty.TargetPort)}") 144: ReferenceExpression.Create($"{endpoint.Property(EndpointProperty.Host)}:{endpoint.Property(EndpointProperty.Port)}"); 221? ReferenceExpression.Create($"PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:{primaryEndpoint.Property(EndpointProperty.Port)},PLAINTEXT_INTERNAL://{resource.Name}:{internalEndpoint.Property(EndpointProperty.TargetPort)}") 222: ReferenceExpression.Create(
KafkaServerResource.cs (2)
37public ReferenceExpression ConnectionStringExpression => 38ReferenceExpression.Create(
Aspire.Hosting.Keycloak (3)
KeycloakResource.cs (3)
26internal ReferenceExpression AdminReference => 28ReferenceExpression.Create($"{AdminUserNameParameter}") : 29ReferenceExpression.Create($"{DefaultAdmin}");
Aspire.Hosting.Milvus (4)
MilvusDatabaseResource.cs (2)
24public ReferenceExpression ConnectionStringExpression => 25ReferenceExpression.Create($"{Parent};Database={DatabaseName}");
MilvusServerResource.cs (2)
41public ReferenceExpression ConnectionStringExpression => 42ReferenceExpression.Create(
Aspire.Hosting.MongoDB (6)
MongoDBDatabaseResource.cs (1)
29public ReferenceExpression ConnectionStringExpression => Parent.BuildConnectionString(DatabaseName);
MongoDBServerResource.cs (5)
46internal ReferenceExpression UserNameReference => 48ReferenceExpression.Create($"{UserNameParameter}") : 49ReferenceExpression.Create($"{DefaultUserName}"); 54public ReferenceExpression ConnectionStringExpression => BuildConnectionString(); 56internal ReferenceExpression BuildConnectionString(string? databaseName = null)
Aspire.Hosting.MySql (4)
MySqlDatabaseResource.cs (2)
22public ReferenceExpression ConnectionStringExpression => 23ReferenceExpression.Create($"{Parent};Database={DatabaseName}");
MySqlServerResource.cs (2)
39public ReferenceExpression ConnectionStringExpression => 40ReferenceExpression.Create(
Aspire.Hosting.Nats (5)
NatsServerResource.cs (5)
43internal ReferenceExpression UserNameReference => 45ReferenceExpression.Create($"{UserNameParameter}") : 46ReferenceExpression.Create($"{DefaultUserName}"); 56public ReferenceExpression ConnectionStringExpression => BuildConnectionString(); 58internal ReferenceExpression BuildConnectionString()
Aspire.Hosting.Oracle (4)
OracleDatabaseResource.cs (2)
22public ReferenceExpression ConnectionStringExpression => 23ReferenceExpression.Create($"{Parent}/{DatabaseName}");
OracleDatabaseServerResource.cs (2)
39public ReferenceExpression ConnectionStringExpression => 40ReferenceExpression.Create(
Aspire.Hosting.PostgreSQL (8)
PostgresDatabaseResource.cs (2)
25public ReferenceExpression ConnectionStringExpression => 26ReferenceExpression.Create($"{Parent};Database={DatabaseName}");
PostgresServerResource.cs (6)
42internal ReferenceExpression UserNameReference => 44ReferenceExpression.Create($"{UserNameParameter}") : 45ReferenceExpression.Create($"{DefaultUserName}"); 52private ReferenceExpression ConnectionString => 53ReferenceExpression.Create( 59public ReferenceExpression ConnectionStringExpression
Aspire.Hosting.Qdrant (4)
QdrantServerResource.cs (4)
46public ReferenceExpression ConnectionStringExpression => 47ReferenceExpression.Create( 53public ReferenceExpression HttpConnectionStringExpression => 54ReferenceExpression.Create(
Aspire.Hosting.RabbitMQ (5)
RabbitMQServerResource.cs (5)
40internal ReferenceExpression UserNameReference => 42ReferenceExpression.Create($"{UserNameParameter}") : 43ReferenceExpression.Create($"{DefaultUserName}"); 53public ReferenceExpression ConnectionStringExpression => 54ReferenceExpression.Create(
Aspire.Hosting.Redis (3)
RedisResource.cs (3)
21private ReferenceExpression ConnectionString => 22ReferenceExpression.Create( 28public ReferenceExpression ConnectionStringExpression
Aspire.Hosting.Seq (2)
SeqResource.cs (2)
24public ReferenceExpression ConnectionStringExpression => 25ReferenceExpression.Create($"{PrimaryEndpoint.Property(EndpointProperty.Url)}");
Aspire.Hosting.SqlServer (5)
SqlServerDatabaseResource.cs (2)
19public ReferenceExpression ConnectionStringExpression => 20ReferenceExpression.Create($"{Parent};Database={DatabaseName}");
SqlServerServerResource.cs (3)
36private ReferenceExpression ConnectionString => 37ReferenceExpression.Create( 43public ReferenceExpression ConnectionStringExpression
Aspire.Hosting.Tests (29)
ExecutableResourceTests.cs (2)
76public ReferenceExpression ConnectionStringExpression => 77ReferenceExpression.Create($"{connectionString}");
ExpressionResolverTests.cs (9)
126Dictionary<string, ReferenceExpression> Expressions { get; } 133{ "TwoFullEndpoints", ReferenceExpression.Create($"Test1={Endpoint1.Property(EndpointProperty.Scheme)}://{Endpoint1.Property(EndpointProperty.IPV4Host)}:{Endpoint1.Property(EndpointProperty.Port)}/;Test2={Endpoint2.Property(EndpointProperty.Scheme)}://{Endpoint2.Property(EndpointProperty.Host)}:{Endpoint2.Property(EndpointProperty.Port)}/;") }, 134{ "Url", ReferenceExpression.Create($"Url={Endpoint1.Property(EndpointProperty.Url)};") }, 135{ "Url2", ReferenceExpression.Create($"Url={Endpoint1};") }, 136{ "OnlyHost", ReferenceExpression.Create($"Host={Endpoint1.Property(EndpointProperty.Host)};") }, 137{ "OnlyPort", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};") }, 138{ "PortBeforeHost", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};Host={Endpoint1.Property(EndpointProperty.Host)};") }, 139{ "FullAndPartial", ReferenceExpression.Create($"Test1={Endpoint1.Property(EndpointProperty.Scheme)}://{Endpoint1.Property(EndpointProperty.IPV4Host)}:{Endpoint1.Property(EndpointProperty.Port)}/;Test2={Endpoint2.Property(EndpointProperty.Scheme)}://localhost:{Endpoint2.Property(EndpointProperty.Port)}/;") } 143public ReferenceExpression ConnectionStringExpression => Expressions[_exprName];
ReferenceExpressionTests.cs (6)
20var refExpression = ReferenceExpression.Create($"Hello {input}"); 38var expr = ReferenceExpression.Create($"{input}").ValueExpression; 49var expr = ReferenceExpression.Create($"{input}", [new HostUrl("test")], parameters).ValueExpression; 61var expr = ReferenceExpression.Create($"{input}", [new HostUrl("test")], [parameterValue]).ValueExpression; 69var expr = ReferenceExpression.Create($"{s}").ValueExpression;
ResourceNotificationTests.cs (2)
389public ReferenceExpression ConnectionStringExpression => 390ReferenceExpression.Create($"CustomConnectionString");
WaitForTests.cs (2)
368public ReferenceExpression ConnectionStringExpression => ReferenceExpression.Create($"foo");
WithEnvironmentTests.cs (6)
76var childExpression = ReferenceExpression.Create($"value"); 77var parameterExpression = ReferenceExpression.Create($"{childExpression}"); 268public ReferenceExpression ConnectionStringExpression => 269ReferenceExpression.Create($"{connectionString}");
WithReferenceTests.cs (2)
307public ReferenceExpression ConnectionStringExpression => 308ReferenceExpression.Create($"{ConnectionString}");
Aspire.Hosting.Valkey (2)
ValkeyResource.cs (2)
24public ReferenceExpression ConnectionStringExpression => 25ReferenceExpression.Create(