Skip to content
Docs Try Aspire
Docs Try

EndpointReference

Class sealed net8.0
📦 Aspire.Hosting v13.3.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
{
// ...
}
View all constructors
ContextNetworkIDget
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.
EndpointAnnotationget
Gets the endpoint annotation associated with the endpoint reference.
EndpointNameget
string
Gets the name of the endpoint associated with the endpoint reference.
ErrorMessageget; init
string?
Gets or sets a custom error message to be thrown when the endpoint annotation is not found.
ExcludeReferenceEndpointget
bool
Gets a value indicating whether this endpoint is excluded from the default set when referencing the resource's endpoints.
Existsget
bool
Gets a value indicating whether the endpoint exists.
Hostget
string
Gets the host for this endpoint.
IsAllocatedget
bool
Gets a value indicating whether the endpoint is allocated.
IsHttpget
bool
Gets a value indicating whether the endpoint uses HTTP scheme.
IsHttpsget
bool
Gets a value indicating whether the endpoint uses HTTPS scheme.
IsHttpSchemeNamedEndpointget
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.
Portget
int
Gets the port for this endpoint.
Resourceget
Gets the resource owner of the endpoint reference.
Schemeget
string
Gets the scheme for this endpoint.
TargetPortget
int?
Gets the target port for this endpoint. If the port is dynamically allocated, this will return null.
TlsEnabledget
bool
Gets a value indicating whether TLS is enabled for this endpoint.
Urlget
string
Gets the URL for this endpoint.
View all properties
View all methods