共用方式為


ICorsService.EvaluatePolicy(HttpContext, CorsPolicy) 方法

定義

使用傳入 context 的 評估指定的 policy

public:
 Microsoft::AspNetCore::Cors::Infrastructure::CorsResult ^ EvaluatePolicy(Microsoft::AspNetCore::Http::HttpContext ^ context, Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicy ^ policy);
public Microsoft.AspNetCore.Cors.Infrastructure.CorsResult EvaluatePolicy (Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy policy);
abstract member EvaluatePolicy : Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy -> Microsoft.AspNetCore.Cors.Infrastructure.CorsResult
Public Function EvaluatePolicy (context As HttpContext, policy As CorsPolicy) As CorsResult

參數

context
HttpContext

HttpContext 呼叫相關聯的 。

policy
CorsPolicy

CorsPolicy需要評估的 。

傳回

CorsResult 其中包含原則評估的結果,而且可由呼叫端用來設定適當的回應標頭。

適用於