AntiforgeryServiceCollectionExtensions.AddAntiforgery Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddAntiforgery(IServiceCollection) |
Adds antiforgery services to the specified IServiceCollection. |
AddAntiforgery(IServiceCollection, Action<AntiforgeryOptions>) |
Adds antiforgery services to the specified IServiceCollection. |
AddAntiforgery(IServiceCollection)
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>)
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.