EndpointReference
Class sealed net10.0
Represents an endpoint reference for a resource with endpoints.
namespace Aspire.Hosting.ApplicationModel;
public sealed class EndpointReference : Aspire.Hosting.ApplicationModel.IManifestExpressionProvider, Aspire.Hosting.ApplicationModel.IValueProvider, Aspire.Hosting.ApplicationModel.IValueWithReferences{ // ...} 21 members
Constructors4
Section titled ConstructorsEndpointReference(IResourceWithEndpoints, EndpointAnnotation, NetworkIdentifier?) Creates a new instance of
EndpointReference with the specified endpoint name. EndpointReference(IResourceWithEndpoints, EndpointAnnotation) Creates a new instance of
EndpointReference with the specified endpoint name. EndpointReference(IResourceWithEndpoints, string, NetworkIdentifier?) Creates a new instance of
EndpointReference with the specified endpoint name. EndpointReference(IResourceWithEndpoints, string) Creates a new instance of
EndpointReference with the specified endpoint name. Properties14
Section titled PropertiesContextNetworkIDget 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.
EndpointNamegetstring Gets the name of the endpoint associated with the endpoint reference.
ErrorMessageget; initstring? Gets or sets a custom error message to be thrown when the endpoint annotation is not found.
Existsgetbool Gets a value indicating whether the endpoint exists.
Hostgetstring Gets the host for this endpoint.
IsAllocatedgetbool Gets a value indicating whether the endpoint is allocated.
IsHttpgetbool Gets a value indicating whether the endpoint uses HTTP scheme.
IsHttpsgetboolPortgetint Gets the port for this endpoint.
Resourceget Gets the resource owner of the endpoint reference.
Schemegetstring Gets the scheme for this endpoint.
TargetPortgetint? Gets the target port for this endpoint. If the port is dynamically allocated, this will return
null. Urlgetstring Gets the URL for this endpoint.
Methods3
Section titled MethodsGetValueAsync(CancellationToken)ValueTask<string?> Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.
GetValueAsync(ValueProviderContext, CancellationToken)ValueTask<string?> Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.
Property(EndpointProperty) Gets the specified property expression of the endpoint. Defaults to the URL if no property is specified.