Partager via


DefaultCorsPolicyProvider.GetPolicyAsync(HttpContext, String) Méthode

Définition

Obtient un CorsPolicy à partir du donné context

public:
 virtual 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>
override this.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)

Paramètres

context
HttpContext

HttpContext associé à cet appel.

policyName
String

Nom de stratégie facultatif à rechercher.

Retours

CorsPolicy

Implémente

S’applique à