From 0b808ca75a54ee83f2b5aca5a077dcb47544fbe9 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 17 Nov 2015 13:46:52 -0800 Subject: [PATCH] ConfigureDP => AddDP --- .../DataProtectionProvider.cs | 5 ++--- .../DataProtectionServiceCollectionExtensions.cs | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.AspNet.DataProtection.Extensions/DataProtectionProvider.cs b/src/Microsoft.AspNet.DataProtection.Extensions/DataProtectionProvider.cs index fe8afe6db6..43764a0274 100644 --- a/src/Microsoft.AspNet.DataProtection.Extensions/DataProtectionProvider.cs +++ b/src/Microsoft.AspNet.DataProtection.Extensions/DataProtectionProvider.cs @@ -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); diff --git a/src/Microsoft.AspNet.DataProtection/DataProtectionServiceCollectionExtensions.cs b/src/Microsoft.AspNet.DataProtection/DataProtectionServiceCollectionExtensions.cs index ff3d3aaac4..cd6dbbd571 100644 --- a/src/Microsoft.AspNet.DataProtection/DataProtectionServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNet.DataProtection/DataProtectionServiceCollectionExtensions.cs @@ -30,13 +30,13 @@ namespace Microsoft.Extensions.DependencyInjection } /// - /// Configures the behavior of the Data Protection system. + /// Adds default Data Protection services to an and configures the behavior of the Data Protection system. /// /// A service collection to which Data Protection has already been added. /// A callback which takes a parameter. /// This callback will be responsible for configuring the system. /// The instance. - public static IServiceCollection ConfigureDataProtection(this IServiceCollection services, Action configure) + public static IServiceCollection AddDataProtection(this IServiceCollection services, Action configure) { if (services == null) { @@ -49,7 +49,7 @@ namespace Microsoft.Extensions.DependencyInjection } configure(new DataProtectionConfiguration(services)); - return services; + return services.AddDataProtection(); } } }