DataProtectionServiceCollectionExtensions.AddDataProtection 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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>
用于配置所提供的 DataProtectionOptions 的 Action<T>。
返回
完成操作后对此实例的引用。