AntiforgeryServiceCollectionExtensions Class

Extension methods for setting up antiforgery services in an Microsoft.Extensions.DependencyInjection.IServiceCollection.

Namespace
Microsoft.Extensions.DependencyInjection
Assemblies
  • Microsoft.AspNetCore.Antiforgery

Syntax

public class AntiforgeryServiceCollectionExtensions
class Microsoft.Extensions.DependencyInjection.AntiforgeryServiceCollectionExtensions

Methods

AddAntiforgery(Microsoft.Extensions.DependencyInjection.IServiceCollection)

Adds antiforgery services to the specified Microsoft.Extensions.DependencyInjection.IServiceCollection.

Arguments:services (Microsoft.Extensions.DependencyInjection.IServiceCollection) – The Microsoft.Extensions.DependencyInjection.IServiceCollection to add services to.
Return type:Microsoft.Extensions.DependencyInjection.IServiceCollection
Returns:The Microsoft.Extensions.DependencyInjection.IServiceCollection so that additional calls can be chained.
public static IServiceCollection AddAntiforgery(this IServiceCollection services)
AddAntiforgery(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Action<Microsoft.AspNetCore.Antiforgery.AntiforgeryOptions>)

Adds antiforgery services to the specified Microsoft.Extensions.DependencyInjection.IServiceCollection.

Arguments:
Return type:

Microsoft.Extensions.DependencyInjection.IServiceCollection

Returns:

The Microsoft.Extensions.DependencyInjection.IServiceCollection so that additional calls can be chained.

public static IServiceCollection AddAntiforgery(this IServiceCollection services, Action<AntiforgeryOptions> setupAction)