CorsOptions.AddPolicy CorsOptions.AddPolicy CorsOptions.AddPolicy Method

Definition

Overloads

AddPolicy(String, CorsPolicy) AddPolicy(String, CorsPolicy) AddPolicy(String, CorsPolicy)

Adds a new policy.

AddPolicy(String, Action<CorsPolicyBuilder>) AddPolicy(String, Action<CorsPolicyBuilder>) AddPolicy(String, Action<CorsPolicyBuilder>)

Adds a new policy.

AddPolicy(String, CorsPolicy) AddPolicy(String, CorsPolicy) AddPolicy(String, CorsPolicy)

Adds a new policy.

public void AddPolicy (string name, Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy policy);
member this.AddPolicy : string * Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy -> unit
Public Sub AddPolicy (name As String, policy As CorsPolicy)

Parameters

name
String String String

The name of the policy.

policy
CorsPolicy CorsPolicy CorsPolicy

The CorsPolicy policy to be added.

AddPolicy(String, Action<CorsPolicyBuilder>) AddPolicy(String, Action<CorsPolicyBuilder>) AddPolicy(String, Action<CorsPolicyBuilder>)

Adds a new policy.

public void AddPolicy (string name, Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> configurePolicy);
member this.AddPolicy : string * Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> -> unit
Public Sub AddPolicy (name As String, configurePolicy As Action(Of CorsPolicyBuilder))

Parameters

name
String String String

The name of the policy.

configurePolicy
Action<CorsPolicyBuilder>

A delegate which can use a policy builder to build a policy.

Applies to