165 references to EndpointProperty
Aspire.Hosting (49)
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 (19)
25async Task<string?> EvalEndpointAsync(EndpointReference endpointReference, EndpointProperty property)
39if (property is EndpointProperty.Host or EndpointProperty.IPV4Host)
43else if (property == EndpointProperty.Port)
47else if (property is EndpointProperty.Url or EndpointProperty.HostAndPort)
66(EndpointProperty.Host or EndpointProperty.IPV4Host, true, true) => target.Name,
67(EndpointProperty.Port, true, true) => await endpointReference.Property(EndpointProperty.TargetPort).GetValueAsync(cancellationToken).ConfigureAwait(false),
69(EndpointProperty.Host or EndpointProperty.IPV4Host, false, _) => containerHostName,
70(EndpointProperty.Url, _, _) => string.Format(CultureInfo.InvariantCulture, "{0}://{1}:{2}",
72await EvalEndpointAsync(endpointReference, EndpointProperty.Host).ConfigureAwait(false),
73await EvalEndpointAsync(endpointReference, EndpointProperty.Port).ConfigureAwait(false)),
74(EndpointProperty.HostAndPort, _, _) => string.Format(CultureInfo.InvariantCulture, "{0}:{1}",
75await EvalEndpointAsync(endpointReference, EndpointProperty.Host).ConfigureAwait(false),
76await EvalEndpointAsync(endpointReference, EndpointProperty.Port).ConfigureAwait(false)),
181EndpointReference endpointReference when sourceIsContainer => new ResolvedValue(await EvalEndpointAsync(endpointReference, EndpointProperty.Url).ConfigureAwait(false), false),
Aspire.Hosting.Azure.AppContainers (9)
Aspire.Hosting.Azure.AppService (9)
AzureAppServiceWebsiteContext.cs (9)
118return (GetValue(context._endpointMapping[ep.EndpointName], EndpointProperty.Url), secretType);
320private BicepValue<string> GetValue(EndpointMapping mapping, EndpointProperty property)
324EndpointProperty.Url => BicepFunction.Interpolate($"{mapping.Scheme}://{mapping.Host}.azurewebsites.net"),
325EndpointProperty.Host => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"),
326EndpointProperty.Port => mapping.Port.ToString(CultureInfo.InvariantCulture),
327EndpointProperty.TargetPort => mapping.TargetPort?.ToString(CultureInfo.InvariantCulture) ?? (BicepValue<string>)AllocateParameter(new ContainerPortReference(Resource)),
328EndpointProperty.Scheme => mapping.Scheme,
329EndpointProperty.HostAndPort => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"),
330EndpointProperty.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.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 (8)
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 (23)
ExpressionResolverTests.cs (18)
200ReferenceExpression.Create($"{PrimaryEndpoint.Property(EndpointProperty.Url)}");
223{ "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)}/;") },
224{ "Url", ReferenceExpression.Create($"Url={Endpoint1.Property(EndpointProperty.Url)};") },
226{ "OnlyHost", ReferenceExpression.Create($"Host={Endpoint1.Property(EndpointProperty.Host)};") },
227{ "OnlyPort", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};") },
228{ "HostAndPort", ReferenceExpression.Create($"HostPort={Endpoint1.Property(EndpointProperty.HostAndPort)}") },
229{ "PortBeforeHost", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};Host={Endpoint1.Property(EndpointProperty.Host)};") },
230{ "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)
Stress.AppHost (3)