Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Configuration Inheritance: System.Object

Syntax

Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration

Summary

CORS (Cross-Origin Resource Sharing) configuration.

Constructors

.ctor

Syntax

public CorsConfiguration()

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

AllowCredentials

Gets or sets a value indicating whether credentials are allowed.

Syntax

public bool AllowCredentials { get; set; }

Property Value

Type: bool

AllowedHeaders

Gets or sets the allowed headers.

Syntax

public System.Collections.Generic.List<string> AllowedHeaders { get; set; }

Property Value

Type: System.Collections.Generic.List<string>

AllowedMethods

Gets or sets the allowed methods.

Syntax

public System.Collections.Generic.List<string> AllowedMethods { get; set; }

Property Value

Type: System.Collections.Generic.List<string>

AllowedOrigins

Gets or sets the allowed origins.

Syntax

public System.Collections.Generic.List<string> AllowedOrigins { get; set; }

Property Value

Type: System.Collections.Generic.List<string>

Enabled

Gets or sets a value indicating whether CORS is enabled.

Syntax

public bool Enabled { get; set; }

Property Value

Type: bool

MaxAge

Gets or sets the maximum age for preflight requests.

Syntax

public System.TimeSpan MaxAge { get; set; }

Property Value

Type: System.TimeSpan

Methods

Clone

Creates a copy of this configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration Clone()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration A new instance with the same settings.

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

MergeWith

Merges another configuration into this one.

Syntax

public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.CorsConfiguration other)

Parameters

NameTypeDescription
otherMicrosoft.OData.Mcp.Core.Configuration.CorsConfigurationThe configuration to merge.

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?

Validate

Validates the CORS configuration.

Syntax

public System.Collections.Generic.IEnumerable<string> Validate()

Returns

Type: System.Collections.Generic.IEnumerable<string> Validation errors.