49 references to EndpointProperty
Aspire.Hosting (49)
ApplicationModel\EndpointReference.cs (24)
49
internal string GetExpression(
EndpointProperty
property =
EndpointProperty
.Url)
53
EndpointProperty
.Url => Binding("url"),
54
EndpointProperty
.Host or
EndpointProperty
.IPV4Host => Binding("host"),
55
EndpointProperty
.Port => Binding("port"),
56
EndpointProperty
.Scheme => Binding("scheme"),
57
EndpointProperty
.TargetPort => Binding("targetPort"),
58
EndpointProperty
.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>
70
public EndpointReferenceExpression Property(
EndpointProperty
property)
149
public class EndpointReferenceExpression(EndpointReference endpointReference,
EndpointProperty
property) : IManifestExpressionProvider, IValueProvider, IValueWithReferences
157
/// Gets the <see cref="
EndpointProperty
"/> for the property expression.
159
public
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>
175
EndpointProperty
.Url => new(Endpoint.Url),
176
EndpointProperty
.Host => new(Endpoint.Host),
177
EndpointProperty
.IPV4Host => new("127.0.0.1"),
178
EndpointProperty
.Port => new(Endpoint.Port.ToString(CultureInfo.InvariantCulture)),
179
EndpointProperty
.Scheme => new(Endpoint.Scheme),
180
EndpointProperty
.TargetPort => new(ComputeTargetPort()),
181
EndpointProperty
.HostAndPort => new($"{Endpoint.Host}:{Endpoint.Port.ToString(CultureInfo.InvariantCulture)}"),
ApplicationModel\ExpressionResolver.cs (19)
25
async Task<string?> EvalEndpointAsync(EndpointReference endpointReference,
EndpointProperty
property)
39
if (property is
EndpointProperty
.Host or
EndpointProperty
.IPV4Host)
43
else if (property ==
EndpointProperty
.Port)
47
else 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}",
72
await EvalEndpointAsync(endpointReference,
EndpointProperty
.Host).ConfigureAwait(false),
73
await EvalEndpointAsync(endpointReference,
EndpointProperty
.Port).ConfigureAwait(false)),
74
(
EndpointProperty
.HostAndPort, _, _) => string.Format(CultureInfo.InvariantCulture, "{0}:{1}",
75
await EvalEndpointAsync(endpointReference,
EndpointProperty
.Host).ConfigureAwait(false),
76
await EvalEndpointAsync(endpointReference,
EndpointProperty
.Port).ConfigureAwait(false)),
181
EndpointReference endpointReference when sourceIsContainer => new ResolvedValue(await EvalEndpointAsync(endpointReference,
EndpointProperty
.Url).ConfigureAwait(false), false),
ProjectResourceBuilderExtensions.cs (5)
757
context.EnvironmentVariables["ASPNETCORE_HTTPS_PORT"] = e.Property(
EndpointProperty
.Port);
765
aspnetCoreUrls.Append($"{e.Property(
EndpointProperty
.Scheme)}://{targetHost}:{e.Property(
EndpointProperty
.TargetPort)}");
810
ports.Append($"{e.Property(
EndpointProperty
.TargetPort)}");
842
var url = ReferenceExpression.Create($"{e.EndpointAnnotation.UriScheme}://{host}:{e.Property(
EndpointProperty
.TargetPort)}");
ResourceBuilderExtensions.cs (1)
581
context.EnvironmentVariables[env] = endpointReference.Property(
EndpointProperty
.TargetPort);