Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
DataProtectionServiceCollectionExtensions.AddDataProtection Method
Definition
- Namespace:
- Microsoft.Extensions.DependencyInjection
- Assembly:
- Microsoft.AspNetCore.DataProtection.dll
- Package:
- Microsoft.AspNetCore.DataProtection v1.0.0
- Package:
- Microsoft.AspNetCore.DataProtection v1.1.0
- Package:
- Microsoft.AspNetCore.DataProtection v10.0.0
- Package:
- Microsoft.AspNetCore.DataProtection v11.0.0-preview.4.26230.115
- Package:
- Microsoft.AspNetCore.DataProtection v2.0.0
- Package:
- Microsoft.AspNetCore.DataProtection v2.1.0
- Package:
- Microsoft.AspNetCore.DataProtection v2.2.0
- Package:
- Microsoft.AspNetCore.DataProtection v3.0.3
- Package:
- Microsoft.AspNetCore.DataProtection v3.1.18
- Package:
- Microsoft.AspNetCore.DataProtection v5.0.9
- Package:
- Microsoft.AspNetCore.DataProtection v6.0.6
- Package:
- Microsoft.AspNetCore.DataProtection v7.0.5
- Package:
- Microsoft.AspNetCore.DataProtection v8.0.19
- Package:
- Microsoft.AspNetCore.DataProtection v9.0.8
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AddDataProtection(IServiceCollection) |
Adds data protection services to the specified IServiceCollection. |
| AddDataProtection(IServiceCollection, Action<DataProtectionOptions>) |
Adds data protection services to the specified IServiceCollection. |
AddDataProtection(IServiceCollection)
Adds data protection services to the specified 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
Parameters
- services
- IServiceCollection
The IServiceCollection to add services to.
Returns
Applies to
AddDataProtection(IServiceCollection, Action<DataProtectionOptions>)
Adds data protection services to the specified 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
Parameters
- services
- IServiceCollection
The IServiceCollection to add services to.
- setupAction
- Action<DataProtectionOptions>
An Action<T> to configure the provided DataProtectionOptions.
Returns
A reference to this instance after the operation has completed.
Applies to
Feedback
Was this page helpful?
