Dela via


CandidateSet.ExpandEndpoint Method

Definition

Replaces the Endpoint at the provided index with the provided endpoints.

public:
 void ExpandEndpoint(int index, System::Collections::Generic::IReadOnlyList<Microsoft::AspNetCore::Http::Endpoint ^> ^ endpoints, System::Collections::Generic::IComparer<Microsoft::AspNetCore::Http::Endpoint ^> ^ comparer);
public void ExpandEndpoint (int index, System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Http.Endpoint> endpoints, System.Collections.Generic.IComparer<Microsoft.AspNetCore.Http.Endpoint> comparer);
member this.ExpandEndpoint : int * System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Http.Endpoint> * System.Collections.Generic.IComparer<Microsoft.AspNetCore.Http.Endpoint> -> unit
Public Sub ExpandEndpoint (index As Integer, endpoints As IReadOnlyList(Of Endpoint), comparer As IComparer(Of Endpoint))

Parameters

index
Int32

The candidate index.

endpoints
IReadOnlyList<Endpoint>

The list of endpoints Endpoint to replace the original Endpoint at the index. If endpoints is empty, the candidate will be marked as invalid.

comparer
IComparer<Endpoint>

The endpoint comparer used to order the endpoints. Can be retrieved from the service provider as type EndpointMetadataComparer.

Remarks

This method supports replacing a dynamic endpoint with a collection of endpoints, and relying on IEndpointSelectorPolicy implementations to disambiguate further.

The endpoint being replace should have a unique score value. The score is the combination of route patter precedence, order, and policy metadata evaluation. A dynamic endpoint will not function correctly if other endpoints exist with the same score.

Applies to