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.IServiceCollectionto add services to.Return type: Microsoft.Extensions.DependencyInjection.IServiceCollection Returns: The Microsoft.Extensions.DependencyInjection.IServiceCollectionso 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: - services (Microsoft.Extensions.DependencyInjection.IServiceCollection) – The
Microsoft.Extensions.DependencyInjection.IServiceCollectionto add services to. - setupAction (System.Action<Microsoft.AspNetCore.Antiforgery.AntiforgeryOptions>) – An
System.Action`1to configure the providedMicrosoft.AspNetCore.Antiforgery.AntiforgeryOptions.
Return type: Returns: The
Microsoft.Extensions.DependencyInjection.IServiceCollectionso that additional calls can be chained.public static IServiceCollection AddAntiforgery(this IServiceCollection services, Action<AntiforgeryOptions> setupAction)
- services (Microsoft.Extensions.DependencyInjection.IServiceCollection) – The
-