ICorsPolicyProvider.GetPolicyAsync(HttpContext, String) 方法

定义

CorsPolicy从给定的 中获取context

public:
 System::Threading::Tasks::Task<Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicy ^> ^ GetPolicyAsync(Microsoft::AspNetCore::Http::HttpContext ^ context, System::String ^ policyName);
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy> GetPolicyAsync (Microsoft.AspNetCore.Http.HttpContext context, string policyName);
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy?> GetPolicyAsync (Microsoft.AspNetCore.Http.HttpContext context, string? policyName);
abstract member GetPolicyAsync : Microsoft.AspNetCore.Http.HttpContext * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy>
Public Function GetPolicyAsync (context As HttpContext, policyName As String) As Task(Of CorsPolicy)

参数

context
HttpContext

HttpContext与此调用关联的 。

policyName
String

要查找的可选策略名称。

返回

一个 CorsPolicy

适用于