共用方式為


AntiforgeryServiceCollectionExtensions.AddAntiforgery 方法

定義

多載

AddAntiforgery(IServiceCollection)

將反Forgery 服務新增至指定的 IServiceCollection

AddAntiforgery(IServiceCollection, Action<AntiforgeryOptions>)

將反Forgery 服務新增至指定的 IServiceCollection

AddAntiforgery(IServiceCollection)

來源:
AntiforgeryServiceCollectionExtensions.cs
來源:
AntiforgeryServiceCollectionExtensions.cs
來源:
AntiforgeryServiceCollectionExtensions.cs

將反Forgery 服務新增至指定的 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>)

來源:
AntiforgeryServiceCollectionExtensions.cs
來源:
AntiforgeryServiceCollectionExtensions.cs
來源:
AntiforgeryServiceCollectionExtensions.cs

將反Forgery 服務新增至指定的 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,以便鏈結其他呼叫。

適用於