EndpointReference
Classsealednet10.0
Represents an endpoint reference for a resource with endpoints.
namespace Aspire.Hosting.ApplicationModel;
public sealed class EndpointReference : Aspire.Hosting.ApplicationModel.IExpressionValue, Aspire.Hosting.ApplicationModel.IManifestExpressionProvider, Aspire.Hosting.ApplicationModel.IValueProvider, Aspire.Hosting.ApplicationModel.IValueWithReferences{ // ...}25 members
Constructors4
Section titled Constructors Creates a new instance of
EndpointReference with the specified endpoint name. Creates a new instance of
EndpointReference with the specified endpoint name. Creates a new instance of
EndpointReference with the specified endpoint name. Creates a new instance of
EndpointReference with the specified endpoint name. Properties17
Section titled Properties The ID of the network that serves as the context for the EndpointReference. The reference will be resolved in the context of this network, which may be different from the network associated with the default network of the referenced Endpoint.
Gets the endpoint annotation associated with the endpoint reference.
ErrorMessageget; initstring? Gets or sets a custom error message to be thrown when the endpoint annotation is not found.
bool Gets a value indicating whether this endpoint is excluded from the default set when referencing the resource's endpoints.
bool Gets a value indicating whether the endpoint name is "http" or "https", ignoring case. This is a convention used to identify endpoints that will be resolved based on the scheme of the endpoint in service discovery rather than by the specific endpoint name. This is done to allow http endpoints that are dynamically updated to https to be mapped correctly despite the endpoint name no longer matching the scheme.
TargetPortgetint? Gets the target port for this endpoint. If the port is dynamically allocated, this will return
null. Methods4
Section titled Methods Creates a conditional
ReferenceExpression that resolves to enabledValue when EndpointAnnotation.TlsEnabled is true on this endpoint, or to disabledValue otherwise. GetValueAsync(CancellationToken)ats exportValueTask<string?> Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.
ValueTask<string?> Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.
Property(EndpointProperty)ats export Gets the specified property expression of the endpoint.