EndpointReference Constructors
Class Constructors 4 members
Represents an endpoint reference for a resource with endpoints.
Constructor(IResourceWithEndpoints, EndpointAnnotation, NetworkIdentifier?) Section titled Constructor(IResourceWithEndpoints, EndpointAnnotation, NetworkIdentifier?) Creates a new instance of
EndpointReference with the specified endpoint name. public sealed class EndpointReference{ public EndpointReference( IResourceWithEndpoints owner, EndpointAnnotation endpoint, NetworkIdentifier? contextNetworkID) { // ... }}Parameters
owner IResourceWithEndpoints The resource with endpoints that owns the referenced endpoint. endpoint EndpointAnnotation The endpoint annotation. contextNetworkID NetworkIdentifier? The ID of the network that serves as the context for the EndpointReference. Remarks
Most Aspire resources are accessed in the context of the "localhost" network (host processes calling other host processes, or host processes calling container via mapped ports). If a
NetworkIdentifier is specified, the EndpointReference will always resolve in the context of that network. If the NetworkIdentifier is null, the reference will attempt to resolve itself based on the context of the requesting resource. Constructor(IResourceWithEndpoints, EndpointAnnotation) Section titled Constructor(IResourceWithEndpoints, EndpointAnnotation) Creates a new instance of
EndpointReference with the specified endpoint name. public sealed class EndpointReference{ public EndpointReference( IResourceWithEndpoints owner, EndpointAnnotation endpoint) { // ... }}Parameters
owner IResourceWithEndpoints The resource with endpoints that owns the referenced endpoint. endpoint EndpointAnnotation The endpoint annotation. Constructor(IResourceWithEndpoints, string, NetworkIdentifier?) Section titled Constructor(IResourceWithEndpoints, string, NetworkIdentifier?) Creates a new instance of
EndpointReference with the specified endpoint name. public sealed class EndpointReference{ public EndpointReference( IResourceWithEndpoints owner, string endpointName, NetworkIdentifier? contextNetworkID = null) { // ... }}Parameters
owner IResourceWithEndpoints The resource with endpoints that owns the referenced endpoint. endpointName string The name of the endpoint. contextNetworkID NetworkIdentifier? optional The ID of the network that serves as the context for the EndpointReference. Remarks
Most Aspire resources are accessed in the context of the "localhost" network (host proceses calling other host processes, or host processes calling container via mapped ports). This is why EndpointReference assumes this context unless specified otherwise. However, for container-to-container, or container-to-host communication, you must specify a container network context for the EndpointReference to be resolved correctly.
Constructor(IResourceWithEndpoints, string) Section titled Constructor(IResourceWithEndpoints, string) Creates a new instance of
EndpointReference with the specified endpoint name. public sealed class EndpointReference{ public EndpointReference( IResourceWithEndpoints owner, string endpointName) { // ... }}Parameters
owner IResourceWithEndpoints The resource with endpoints that owns the referenced endpoint. endpointName string The name of the endpoint.