React to DataProtection changes

This commit is contained in:
Hao Kung 2015-11-17 14:08:22 -08:00
parent 4c74e08bf1
commit e2632d47f0
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Antiforgery
// Arrange // Arrange
var serviceCollection = new ServiceCollection(); var serviceCollection = new ServiceCollection();
serviceCollection.AddAntiforgery(); serviceCollection.AddAntiforgery();
serviceCollection.ConfigureDataProtection(o => o.SetApplicationName(applicationId)); serviceCollection.AddDataProtection(o => o.SetApplicationName(applicationId));
var services = serviceCollection.BuildServiceProvider(); var services = serviceCollection.BuildServiceProvider();
var options = services.GetRequiredService<IOptions<AntiforgeryOptions>>(); var options = services.GetRequiredService<IOptions<AntiforgeryOptions>>();
@ -42,7 +42,7 @@ namespace Microsoft.AspNet.Antiforgery
o.CookieName = "antiforgery"; o.CookieName = "antiforgery";
}); });
serviceCollection.AddAntiforgery(); serviceCollection.AddAntiforgery();
serviceCollection.ConfigureDataProtection(o => o.SetApplicationName("HelloWorldApp")); serviceCollection.AddDataProtection(o => o.SetApplicationName("HelloWorldApp"));
var services = serviceCollection.BuildServiceProvider(); var services = serviceCollection.BuildServiceProvider();
var options = services.GetRequiredService<IOptions<AntiforgeryOptions>>(); var options = services.GetRequiredService<IOptions<AntiforgeryOptions>>();