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