Skip to content
This repository was archived by the owner on Oct 17, 2018. It is now read-only.

Commit 0b808ca

Browse files
committed
ConfigureDP => AddDP
1 parent 5c94e89 commit 0b808ca

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/Microsoft.AspNet.DataProtection.Extensions/DataProtectionProvider.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ public DataProtectionProvider(DirectoryInfo keyDirectory, Action<DataProtectionC
4141
}
4242

4343
// build the service collection
44-
ServiceCollection serviceCollection = new ServiceCollection();
45-
serviceCollection.AddDataProtection();
46-
serviceCollection.ConfigureDataProtection(configurationObject =>
44+
var serviceCollection = new ServiceCollection();
45+
serviceCollection.AddDataProtection(configurationObject =>
4746
{
4847
configurationObject.PersistKeysToFileSystem(keyDirectory);
4948
configure?.Invoke(configurationObject);

src/Microsoft.AspNet.DataProtection/DataProtectionServiceCollectionExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ public static IServiceCollection AddDataProtection(this IServiceCollection servi
3030
}
3131

3232
/// <summary>
33-
/// Configures the behavior of the Data Protection system.
33+
/// Adds default Data Protection services to an <see cref="IServiceCollection"/> and configures the behavior of the Data Protection system.
3434
/// </summary>
3535
/// <param name="services">A service collection to which Data Protection has already been added.</param>
3636
/// <param name="configure">A callback which takes a <see cref="DataProtectionConfiguration"/> parameter.
3737
/// This callback will be responsible for configuring the system.</param>
3838
/// <returns>The <paramref name="services"/> instance.</returns>
39-
public static IServiceCollection ConfigureDataProtection(this IServiceCollection services, Action<DataProtectionConfiguration> configure)
39+
public static IServiceCollection AddDataProtection(this IServiceCollection services, Action<DataProtectionConfiguration> configure)
4040
{
4141
if (services == null)
4242
{
@@ -49,7 +49,7 @@ public static IServiceCollection ConfigureDataProtection(this IServiceCollection
4949
}
5050

5151
configure(new DataProtectionConfiguration(services));
52-
return services;
52+
return services.AddDataProtection();
5353
}
5454
}
5555
}

0 commit comments

Comments
 (0)