EndpointReference Constructors
ClassConstructors4 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
ownerIendpointEndpointcontextNetworkId NetworkRemarks
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
ownerIendpointEndpointConstructor(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
ownerIendpointName stringThe name of the endpoint.contextNetworkId NetworkRemarks
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
ownerIendpointName stringThe name of the endpoint.