Share via


EndpointReference Constructors

Definition

Overloads

EndpointReference(IResourceWithEndpoints, EndpointAnnotation)

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.

EndpointReference(IResourceWithEndpoints, EndpointAnnotation, NetworkIdentifier)

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, EndpointAnnotation)

Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs

Creates a new instance of EndpointReference with the specified endpoint name.

public EndpointReference(Aspire.Hosting.ApplicationModel.IResourceWithEndpoints owner, Aspire.Hosting.ApplicationModel.EndpointAnnotation endpoint);
new Aspire.Hosting.ApplicationModel.EndpointReference : Aspire.Hosting.ApplicationModel.IResourceWithEndpoints * Aspire.Hosting.ApplicationModel.EndpointAnnotation -> Aspire.Hosting.ApplicationModel.EndpointReference
Public Sub New (owner As IResourceWithEndpoints, endpoint As EndpointAnnotation)

Parameters

owner
IResourceWithEndpoints

The resource with endpoints that owns the referenced endpoint.

endpoint
EndpointAnnotation

The endpoint annotation.

Applies to

EndpointReference(IResourceWithEndpoints, String)

Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs
Source:
EndpointReference.cs

Creates a new instance of EndpointReference with the specified endpoint name.

public EndpointReference(Aspire.Hosting.ApplicationModel.IResourceWithEndpoints owner, string endpointName);
new Aspire.Hosting.ApplicationModel.EndpointReference : Aspire.Hosting.ApplicationModel.IResourceWithEndpoints * string -> Aspire.Hosting.ApplicationModel.EndpointReference
Public Sub New (owner As IResourceWithEndpoints, endpointName As String)

Parameters

owner
IResourceWithEndpoints

The resource with endpoints that owns the referenced endpoint.

endpointName
String

The name of the endpoint.

Applies to

EndpointReference(IResourceWithEndpoints, EndpointAnnotation, NetworkIdentifier)

Source:
EndpointReference.cs

Creates a new instance of EndpointReference with the specified endpoint name.

public EndpointReference(Aspire.Hosting.ApplicationModel.IResourceWithEndpoints owner, Aspire.Hosting.ApplicationModel.EndpointAnnotation endpoint, Aspire.Hosting.ApplicationModel.NetworkIdentifier? contextNetworkID);
new Aspire.Hosting.ApplicationModel.EndpointReference : Aspire.Hosting.ApplicationModel.IResourceWithEndpoints * Aspire.Hosting.ApplicationModel.EndpointAnnotation * Aspire.Hosting.ApplicationModel.NetworkIdentifier -> Aspire.Hosting.ApplicationModel.EndpointReference
Public Sub New (owner As IResourceWithEndpoints, endpoint As EndpointAnnotation, contextNetworkID As NetworkIdentifier)

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.

Applies to

EndpointReference(IResourceWithEndpoints, String, NetworkIdentifier)

Source:
EndpointReference.cs

Creates a new instance of EndpointReference with the specified endpoint name.

public EndpointReference(Aspire.Hosting.ApplicationModel.IResourceWithEndpoints owner, string endpointName, Aspire.Hosting.ApplicationModel.NetworkIdentifier? contextNetworkID = default);
new Aspire.Hosting.ApplicationModel.EndpointReference : Aspire.Hosting.ApplicationModel.IResourceWithEndpoints * string * Aspire.Hosting.ApplicationModel.NetworkIdentifier -> Aspire.Hosting.ApplicationModel.EndpointReference
Public Sub New (owner As IResourceWithEndpoints, endpointName As String, Optional contextNetworkID As NetworkIdentifier = Nothing)

Parameters

owner
IResourceWithEndpoints

The resource with endpoints that owns the referenced endpoint.

endpointName
String

The name of the endpoint.

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 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.

Applies to