Share via


AntiforgeryServiceCollectionExtensions.AddAntiforgery Method

Definition

Overloads

AddAntiforgery(IServiceCollection)

Adds antiforgery services to the specified IServiceCollection.

AddAntiforgery(IServiceCollection, Action<AntiforgeryOptions>)

Adds antiforgery services to the specified IServiceCollection.

AddAntiforgery(IServiceCollection)

Source:
AntiforgeryServiceCollectionExtensions.cs
Source:
AntiforgeryServiceCollectionExtensions.cs
Source:
AntiforgeryServiceCollectionExtensions.cs

Adds antiforgery services to the specified IServiceCollection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAntiforgery (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddAntiforgery : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAntiforgery (services As IServiceCollection) As IServiceCollection

Parameters

services
IServiceCollection

The IServiceCollection to add services to.

Returns

The IServiceCollection so that additional calls can be chained.

Applies to

AddAntiforgery(IServiceCollection, Action<AntiforgeryOptions>)

Source:
AntiforgeryServiceCollectionExtensions.cs
Source:
AntiforgeryServiceCollectionExtensions.cs
Source:
AntiforgeryServiceCollectionExtensions.cs

Adds antiforgery services to the specified IServiceCollection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAntiforgery (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Antiforgery.AntiforgeryOptions> setupAction);
static member AddAntiforgery : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Antiforgery.AntiforgeryOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAntiforgery (services As IServiceCollection, setupAction As Action(Of AntiforgeryOptions)) As IServiceCollection

Parameters

services
IServiceCollection

The IServiceCollection to add services to.

setupAction
Action<AntiforgeryOptions>

An Action<T> to configure the provided AntiforgeryOptions.

Returns

The IServiceCollection so that additional calls can be chained.

Applies to