EnableCorsAttribute Class

Definition

An interface which can be used to identify a type which provides metadata needed for enabling CORS support.

C#
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class EnableCorsAttribute : Attribute, Microsoft.AspNetCore.Cors.Infrastructure.IEnableCorsAttribute
C#
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class EnableCorsAttribute : Attribute, Microsoft.AspNetCore.Cors.Infrastructure.ICorsMetadata, Microsoft.AspNetCore.Cors.Infrastructure.IEnableCorsAttribute
Inheritance
EnableCorsAttribute
Attributes
Implements

Constructors

EnableCorsAttribute()

Creates a new instance of the EnableCorsAttribute with the default policy name defined by DefaultPolicyName.

EnableCorsAttribute(String)

Creates a new instance of the EnableCorsAttribute with the supplied policy name.

Properties

PolicyName

The name of the policy which needs to be applied.

Methods

ToString() System.Attribute.ToString

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0