Share via


CorsEndpointConventionBuilderExtensions.RequireCors Method

Definition

Overloads

RequireCors<TBuilder>(TBuilder)

Adds a CORS policy with the default policy name to the endpoint(s).

RequireCors<TBuilder>(TBuilder, Action<CorsPolicyBuilder>)

Adds the specified CORS policy to the endpoint(s).

RequireCors<TBuilder>(TBuilder, String)

Adds a CORS policy with the specified name to the endpoint(s).

RequireCors<TBuilder>(TBuilder)

Source:
CorsEndpointConventionBuilderExtensions.cs

Adds a CORS policy with the default policy name to the endpoint(s).

public static TBuilder RequireCors<TBuilder> (this TBuilder builder) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireCors : 'Builder -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireCors(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder) As TBuilder

Type Parameters

TBuilder

Parameters

builder
TBuilder

The endpoint convention builder.

Returns

TBuilder

The original convention builder parameter.

Applies to

RequireCors<TBuilder>(TBuilder, Action<CorsPolicyBuilder>)

Source:
CorsEndpointConventionBuilderExtensions.cs

Adds the specified CORS policy to the endpoint(s).

public:
generic <typename TBuilder>
 where TBuilder : Microsoft::AspNetCore::Builder::IEndpointConventionBuilder[System::Runtime::CompilerServices::Extension]
 static TBuilder RequireCors(TBuilder builder, Action<Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicyBuilder ^> ^ configurePolicy);
public static TBuilder RequireCors<TBuilder> (this TBuilder builder, Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> configurePolicy) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireCors : 'Builder * Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireCors(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, configurePolicy As Action(Of CorsPolicyBuilder)) As TBuilder

Type Parameters

TBuilder

Parameters

builder
TBuilder

The endpoint convention builder.

configurePolicy
Action<CorsPolicyBuilder>

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

Returns

TBuilder

The original convention builder parameter.

Applies to

RequireCors<TBuilder>(TBuilder, String)

Source:
CorsEndpointConventionBuilderExtensions.cs

Adds a CORS policy with the specified name to the endpoint(s).

public:
generic <typename TBuilder>
 where TBuilder : Microsoft::AspNetCore::Builder::IEndpointConventionBuilder[System::Runtime::CompilerServices::Extension]
 static TBuilder RequireCors(TBuilder builder, System::String ^ policyName);
public static TBuilder RequireCors<TBuilder> (this TBuilder builder, string policyName) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireCors : 'Builder * string -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireCors(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, policyName As String) As TBuilder

Type Parameters

TBuilder

Parameters

builder
TBuilder

The endpoint convention builder.

policyName
String

The CORS policy name.

Returns

TBuilder

The original convention builder parameter.

Applies to