IEndpointSelectorPolicy.ApplyAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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
返回
注解
的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
返回
注解
的IEndpointSelectorPolicy实现应实现此方法,并通过根据需要将 设置为 SetValidity(Int32, Boolean) 来false
筛选 中的candidates
候选项集。
若要发出错误条件的信号,请将 设置为 Endpoint 一个 Endpoint 值,该值在执行时将产生所需的错误。