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>。
傳回
完成作業之後,這個執行個體的參考。