IEndpointSelectorPolicy.ApplyAsync 方法

定义

重载

ApplyAsync(HttpContext, CandidateSet)

将策略应用于 CandidateSet

ApplyAsync(HttpContext, EndpointSelectorContext, CandidateSet)

将策略应用于 CandidateSet

ApplyAsync(HttpContext, CandidateSet)

Source:
IEndpointSelectorPolicy.cs

将策略应用于 CandidateSet

public:
 System::Threading::Tasks::Task ^ ApplyAsync(Microsoft::AspNetCore::Http::HttpContext ^ httpContext, Microsoft::AspNetCore::Routing::Matching::CandidateSet ^ candidates);
public System.Threading.Tasks.Task ApplyAsync (Microsoft.AspNetCore.Http.HttpContext httpContext, Microsoft.AspNetCore.Routing.Matching.CandidateSet candidates);
abstract member ApplyAsync : Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Routing.Matching.CandidateSet -> System.Threading.Tasks.Task
Public Function ApplyAsync (httpContext As HttpContext, candidates As CandidateSet) As Task

参数

httpContext
HttpContext

HttpContext 当前请求关联的 。

candidates
CandidateSet

CandidateSet

返回

注解

IEndpointSelectorPolicy实现应实现此方法,并通过根据需要将 设置为 SetValidity(Int32, Boolean)false筛选 中的candidates候选项集。

若要发出错误条件的信号, IEndpointSelectorPolicy 应通过调用 SetEndpoint(HttpContext, Endpoint) 并将 设置为 RouteValues 在执行时将产生所需错误的 值来 Endpoint 分配终结点。

适用于

ApplyAsync(HttpContext, EndpointSelectorContext, CandidateSet)

将策略应用于 CandidateSet

public:
 System::Threading::Tasks::Task ^ ApplyAsync(Microsoft::AspNetCore::Http::HttpContext ^ httpContext, Microsoft::AspNetCore::Routing::EndpointSelectorContext ^ context, Microsoft::AspNetCore::Routing::Matching::CandidateSet ^ candidates);
public System.Threading.Tasks.Task ApplyAsync (Microsoft.AspNetCore.Http.HttpContext httpContext, Microsoft.AspNetCore.Routing.EndpointSelectorContext context, Microsoft.AspNetCore.Routing.Matching.CandidateSet candidates);
abstract member ApplyAsync : Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Routing.EndpointSelectorContext * Microsoft.AspNetCore.Routing.Matching.CandidateSet -> System.Threading.Tasks.Task
Public Function ApplyAsync (httpContext As HttpContext, context As EndpointSelectorContext, candidates As CandidateSet) As Task

参数

httpContext
HttpContext

HttpContext 当前请求关联的 。

context
EndpointSelectorContext

EndpointSelectorContext 当前请求关联的 。

candidates
CandidateSet

CandidateSet

返回

注解

IEndpointSelectorPolicy实现应实现此方法,并通过根据需要将 设置为 SetValidity(Int32, Boolean)false筛选 中的candidates候选项集。

若要发出错误条件的信号,请将 设置为 Endpoint 一个 Endpoint 值,该值在执行时将产生所需的错误。

适用于