CorsEndpointConventionBuilderExtensions.RequireCors Method

Definition

Overloads

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, Action<CorsPolicyBuilder>)

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.

RequireCors<TBuilder>(TBuilder, String)

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