Sdílet prostřednictvím


DefaultCorsPolicyProvider.GetPolicyAsync(HttpContext, String) Metoda

Definice

Získá z daného objektu CorsPolicycontext

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)

Parametry

context
HttpContext

Přidružená HttpContext k tomuto volání.

policyName
String

Volitelný název zásady, který chcete vyhledat.

Návraty

Provede CorsPolicy.

Implementuje

Platí pro