172 references to EndpointProperty
Aspire.Hosting (48)
ApplicationModel\EndpointReference.cs (24)
49internal string GetExpression(EndpointProperty property = EndpointProperty.Url)
53EndpointProperty.Url => Binding("url"),
54EndpointProperty.Host or EndpointProperty.IPV4Host => Binding("host"),
55EndpointProperty.Port => Binding("port"),
56EndpointProperty.Scheme => Binding("scheme"),
57EndpointProperty.TargetPort => Binding("targetPort"),
58EndpointProperty.HostAndPort => $"{Binding("host")}:{Binding("port")}",
68/// <param name="property">The <see cref="EndpointProperty"/> enum value to use in the reference.</param>
69/// <returns>An <see cref="EndpointReferenceExpression"/> representing the specified <see cref="EndpointProperty"/>.</returns>
70public EndpointReferenceExpression Property(EndpointProperty property)
149public class EndpointReferenceExpression(EndpointReference endpointReference, EndpointProperty property) : IManifestExpressionProvider, IValueProvider, IValueWithReferences
157/// Gets the <see cref="EndpointProperty"/> for the property expression.
159public EndpointProperty Property { get; } = property;
171/// <returns>A <see cref="string"/> containing the selected <see cref="EndpointProperty"/> value.</returns>
172/// <exception cref="InvalidOperationException">Throws when the selected <see cref="EndpointProperty"/> enumeration is not known.</exception>
175EndpointProperty.Url => new(Endpoint.Url),
176EndpointProperty.Host => new(Endpoint.Host),
177EndpointProperty.IPV4Host => new("127.0.0.1"),
178EndpointProperty.Port => new(Endpoint.Port.ToString(CultureInfo.InvariantCulture)),
179EndpointProperty.Scheme => new(Endpoint.Scheme),
180EndpointProperty.TargetPort => new(ComputeTargetPort()),
181EndpointProperty.HostAndPort => new($"{Endpoint.Host}:{Endpoint.Port.ToString(CultureInfo.InvariantCulture)}"),
ApplicationModel\ExpressionResolver.cs (14)
11async Task<string?> EvalEndpointAsync(EndpointReference endpointReference, EndpointProperty property)
20(EndpointProperty.Host or EndpointProperty.IPV4Host, true) => target.Name,
21(EndpointProperty.Port, true) => await endpointReference.Property(EndpointProperty.TargetPort).GetValueAsync(cancellationToken).ConfigureAwait(false),
23(EndpointProperty.Host or EndpointProperty.IPV4Host, false) => containerHostName,
24(EndpointProperty.Url, _) => string.Format(CultureInfo.InvariantCulture, "{0}://{1}:{2}",
26await EvalEndpointAsync(endpointReference, EndpointProperty.Host).ConfigureAwait(false),
27await EvalEndpointAsync(endpointReference, EndpointProperty.Port).ConfigureAwait(false)),
28(EndpointProperty.HostAndPort, _) => string.Format(CultureInfo.InvariantCulture, "{0}:{1}",
29await EvalEndpointAsync(endpointReference, EndpointProperty.Host).ConfigureAwait(false),
30await EvalEndpointAsync(endpointReference, EndpointProperty.Port).ConfigureAwait(false)),
135EndpointReference endpointReference when sourceIsContainer => new ResolvedValue(await EvalEndpointAsync(endpointReference, EndpointProperty.Url).ConfigureAwait(false), false),
Aspire.Hosting.Azure.AppConfiguration (1)
Aspire.Hosting.Azure.AppContainers (9)
Aspire.Hosting.Azure.AppService (9)
AzureAppServiceWebsiteContext.cs (9)
119return (GetValue(context._endpointMapping[ep.EndpointName], EndpointProperty.Url), secretType);
321private BicepValue<string> GetValue(EndpointMapping mapping, EndpointProperty property)
325EndpointProperty.Url => BicepFunction.Interpolate($"{mapping.Scheme}://{mapping.Host}.azurewebsites.net"),
326EndpointProperty.Host => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"),
327EndpointProperty.Port => mapping.Port.ToString(CultureInfo.InvariantCulture),
328EndpointProperty.TargetPort => mapping.TargetPort?.ToString(CultureInfo.InvariantCulture) ?? (BicepValue<string>)AllocateParameter(new ContainerPortReference(Resource)),
329EndpointProperty.Scheme => mapping.Scheme,
330EndpointProperty.HostAndPort => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"),
331EndpointProperty.IPV4Host => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"),
Aspire.Hosting.Azure.CosmosDB (3)
Aspire.Hosting.Azure.EventHubs (1)
Aspire.Hosting.Azure.Functions (2)
Aspire.Hosting.Azure.Kusto (3)
Aspire.Hosting.Azure.PostgreSQL (1)
Aspire.Hosting.Azure.Redis (2)
Aspire.Hosting.Azure.ServiceBus (1)
Aspire.Hosting.Azure.SignalR (1)
Aspire.Hosting.Azure.Storage (3)
Aspire.Hosting.Azure.Tests (16)
Aspire.Hosting.Docker (9)
Aspire.Hosting.Docker.Tests (2)
Aspire.Hosting.Garnet (1)
Aspire.Hosting.Kafka (7)
Aspire.Hosting.Kubernetes (9)
Aspire.Hosting.Milvus (1)
Aspire.Hosting.MongoDB (1)
Aspire.Hosting.MySql (2)
Aspire.Hosting.Nats (1)
Aspire.Hosting.Oracle (1)
Aspire.Hosting.PostgreSQL (2)
Aspire.Hosting.Qdrant (2)
Aspire.Hosting.RabbitMQ (1)
Aspire.Hosting.Redis (1)
Aspire.Hosting.Seq (1)
Aspire.Hosting.SqlServer (2)
Aspire.Hosting.Tests (24)
ExpressionResolverTests.cs (18)
199ReferenceExpression.Create($"{PrimaryEndpoint.Property(EndpointProperty.Url)}");
222{ "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)}/;") },
223{ "Url", ReferenceExpression.Create($"Url={Endpoint1.Property(EndpointProperty.Url)};") },
225{ "OnlyHost", ReferenceExpression.Create($"Host={Endpoint1.Property(EndpointProperty.Host)};") },
226{ "OnlyPort", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};") },
227{ "HostAndPort", ReferenceExpression.Create($"HostPort={Endpoint1.Property(EndpointProperty.HostAndPort)}") },
228{ "PortBeforeHost", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};Host={Endpoint1.Property(EndpointProperty.Host)};") },
229{ "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)}/;") },
Aspire.Hosting.Valkey (1)
AspireWithNode.AppHost (1)
Stress.AppHost (3)