DataProtectionServiceCollectionExtensions.AddDataProtection 方法

定义

重载

AddDataProtection(IServiceCollection)

将数据保护服务添加到指定的 IServiceCollection

AddDataProtection(IServiceCollection, Action<DataProtectionOptions>)

将数据保护服务添加到指定的 IServiceCollection

AddDataProtection(IServiceCollection)

将数据保护服务添加到指定的 IServiceCollection

public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder AddDataProtection (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddDataProtection : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder
<Extension()>
Public Function AddDataProtection (services As IServiceCollection) As IDataProtectionBuilder

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

返回

适用于

AddDataProtection(IServiceCollection, Action<DataProtectionOptions>)

将数据保护服务添加到指定的 IServiceCollection

public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder AddDataProtection (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.DataProtection.DataProtectionOptions> setupAction);
static member AddDataProtection : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.DataProtection.DataProtectionOptions> -> Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder
<Extension()>
Public Function AddDataProtection (services As IServiceCollection, setupAction As Action(Of DataProtectionOptions)) As IDataProtectionBuilder

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

setupAction
Action<DataProtectionOptions>

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

返回

完成操作后对此实例的引用。

适用于