diff --git a/samples/IdentitySample.Mvc/Startup.cs b/samples/IdentitySample.Mvc/Startup.cs index 07201b617d..86cd73afa9 100644 --- a/samples/IdentitySample.Mvc/Startup.cs +++ b/samples/IdentitySample.Mvc/Startup.cs @@ -23,9 +23,11 @@ namespace IdentitySamples * Below code demonstrates usage of multiple configuration sources. For instance a setting say 'setting1' is found in both the registered sources, * then the later source will win. By this way a Local config can be overridden by a different setting while deployed remotely. */ - Configuration = new ConfigurationSection(env.ApplicationBasePath) + var builder = new ConfigurationBuilder(env.ApplicationBasePath) .AddJsonFile("LocalConfig.json") .AddEnvironmentVariables(); //All environment variables in the process's context flow in as configuration values. + + Configuration = builder.Build(); } public IConfiguration Configuration { get; private set; } diff --git a/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs b/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs index 51212b5b31..a6a27ae4b5 100644 --- a/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs +++ b/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs @@ -61,7 +61,8 @@ namespace Microsoft.AspNet.Identity.Test {"identity:lockout:EnabledByDefault", "TRUe"}, {"identity:lockout:MaxFailedAccessAttempts", "1000"} }; - var config = new ConfigurationSection(new MemoryConfigurationSource(dic)); + var builder = new ConfigurationBuilder(new MemoryConfigurationSource(dic)); + var config = builder.Build(); Assert.Equal(roleClaimType, config.Get("identity:claimsidentity:roleclaimtype")); var services = new ServiceCollection(); @@ -93,7 +94,8 @@ namespace Microsoft.AspNet.Identity.Test {"identity:user:requireUniqueEmail", "true"}, {"identity:lockout:MaxFailedAccessAttempts", "1000"} }; - var config = new ConfigurationSection(new MemoryConfigurationSource(dic)); + var builder = new ConfigurationBuilder(new MemoryConfigurationSource(dic)); + var config = builder.Build(); var services = new ServiceCollection(); services.ConfigureIdentity(config.GetConfigurationSection("identity")); services.AddIdentity(o => { o.User.RequireUniqueEmail = false; o.Lockout.MaxFailedAccessAttempts++; });