CorsOptions.AddDefaultPolicy Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
AddDefaultPolicy(CorsPolicy) |
Adds a new policy and sets it as the default. |
AddDefaultPolicy(Action<CorsPolicyBuilder>) |
Adds a new policy and sets it as the default. |
- Source:
- CorsOptions.cs
- Source:
- CorsOptions.cs
- Source:
- CorsOptions.cs
Adds a new policy and sets it as the default.
public:
void AddDefaultPolicy(Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicy ^ policy);
C#
public void AddDefaultPolicy (Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy policy);
member this.AddDefaultPolicy : Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy -> unit
Public Sub AddDefaultPolicy (policy As CorsPolicy)
Parameters
- policy
- CorsPolicy
The CorsPolicy policy to be added.
Applies to
ASP.NET Core 9.0 dan versi lain
Produk | Versi |
---|---|
ASP.NET Core | 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
- Source:
- CorsOptions.cs
- Source:
- CorsOptions.cs
- Source:
- CorsOptions.cs
Adds a new policy and sets it as the default.
public:
void AddDefaultPolicy(Action<Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicyBuilder ^> ^ configurePolicy);
C#
public void AddDefaultPolicy (Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> configurePolicy);
member this.AddDefaultPolicy : Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> -> unit
Public Sub AddDefaultPolicy (configurePolicy As Action(Of CorsPolicyBuilder))
Parameters
- configurePolicy
- Action<CorsPolicyBuilder>
A delegate which can use a policy builder to build a policy.
Applies to
ASP.NET Core 9.0 dan versi lain
Produk | Versi |
---|---|
ASP.NET Core | 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |