AntiforgeryServiceCollectionExtensions.AddAntiforgery 方法

定义

重载

AddAntiforgery(IServiceCollection)

将防伪造服务添加到指定的 IServiceCollection

AddAntiforgery(IServiceCollection, Action<AntiforgeryOptions>)

将防伪造服务添加到指定的 IServiceCollection

AddAntiforgery(IServiceCollection)

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

将防伪造服务添加到指定的 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

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

返回

IServiceCollection,以便可以链接其他调用。

适用于

AddAntiforgery(IServiceCollection, Action<AntiforgeryOptions>)

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

将防伪造服务添加到指定的 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

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

setupAction
Action<AntiforgeryOptions>

用于配置所提供的 AntiforgeryOptionsAction<T>

返回

IServiceCollection,以便可以链接其他调用。

适用于