ConfigureDP => AddDP
This commit is contained in:
parent
5c94e8923a
commit
0b808ca75a
|
|
@ -41,9 +41,8 @@ namespace Microsoft.AspNet.DataProtection
|
|||
}
|
||||
|
||||
// build the service collection
|
||||
ServiceCollection serviceCollection = new ServiceCollection();
|
||||
serviceCollection.AddDataProtection();
|
||||
serviceCollection.ConfigureDataProtection(configurationObject =>
|
||||
var serviceCollection = new ServiceCollection();
|
||||
serviceCollection.AddDataProtection(configurationObject =>
|
||||
{
|
||||
configurationObject.PersistKeysToFileSystem(keyDirectory);
|
||||
configure?.Invoke(configurationObject);
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the behavior of the Data Protection system.
|
||||
/// Adds default Data Protection services to an <see cref="IServiceCollection"/> and configures the behavior of the Data Protection system.
|
||||
/// </summary>
|
||||
/// <param name="services">A service collection to which Data Protection has already been added.</param>
|
||||
/// <param name="configure">A callback which takes a <see cref="DataProtectionConfiguration"/> parameter.
|
||||
/// This callback will be responsible for configuring the system.</param>
|
||||
/// <returns>The <paramref name="services"/> instance.</returns>
|
||||
public static IServiceCollection ConfigureDataProtection(this IServiceCollection services, Action<DataProtectionConfiguration> configure)
|
||||
public static IServiceCollection AddDataProtection(this IServiceCollection services, Action<DataProtectionConfiguration> configure)
|
||||
{
|
||||
if (services == null)
|
||||
{
|
||||
|
|
@ -49,7 +49,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
}
|
||||
|
||||
configure(new DataProtectionConfiguration(services));
|
||||
return services;
|
||||
return services.AddDataProtection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue