fix build break due to aspnet/configuration #246

This commit is contained in:
Kirthi Krishnamraju 2015-08-14 00:07:35 -07:00
parent 62a1d49710
commit a669ae18b7
2 changed files with 6 additions and 6 deletions

View File

@ -36,11 +36,11 @@ namespace IdentitySamples
{
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.Get("Data:IdentityConnection:ConnectionString")));
.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration["Data:IdentityConnection:ConnectionString"]));
services.Configure<IdentityDbContextOptions>(options =>
{
options.DefaultAdminUserName = Configuration.Get("DefaultAdminUsername");
options.DefaultAdminPassword = Configuration.Get("DefaultAdminPassword");
options.DefaultAdminUserName = Configuration["DefaultAdminUsername"];
options.DefaultAdminPassword = Configuration["DefaultAdminPassword"];
});
services.AddIdentity<ApplicationUser, IdentityRole>()

View File

@ -62,11 +62,11 @@ namespace Microsoft.AspNet.Identity.Test
};
var builder = new ConfigurationBuilder(new MemoryConfigurationSource(dic));
var config = builder.Build();
Assert.Equal(roleClaimType, config.Get("identity:claimsidentity:roleclaimtype"));
Assert.Equal(roleClaimType, config["identity:claimsidentity:roleclaimtype"]);
var services = new ServiceCollection();
services.AddIdentity<TestUser,TestRole>();
services.ConfigureIdentity(config.GetConfigurationSection("identity"));
services.ConfigureIdentity(config.GetSection("identity"));
var accessor = services.BuildServiceProvider().GetRequiredService<IOptions<IdentityOptions>>();
Assert.NotNull(accessor);
var options = accessor.Options;
@ -96,7 +96,7 @@ namespace Microsoft.AspNet.Identity.Test
var builder = new ConfigurationBuilder(new MemoryConfigurationSource(dic));
var config = builder.Build();
var services = new ServiceCollection();
services.ConfigureIdentity(config.GetConfigurationSection("identity"));
services.ConfigureIdentity(config.GetSection("identity"));
services.AddIdentity<TestUser, TestRole>(o => { o.User.RequireUniqueEmail = false; o.Lockout.MaxFailedAccessAttempts++; });
var accessor = services.BuildServiceProvider().GetRequiredService<IOptions<IdentityOptions>>();
Assert.NotNull(accessor);