Я пытаюсь создать миграцию удостоверений в ASP.NET Core 2.0 и получаю сообщение об ошибке.
System.Data.SqlClient.SqlException (0x80131904): не удается открыть базу данных «MarketIdentity», запрошенную при входе в систему. Вход не выполнен.
Appsettings.json
"MarketIdentity": {
"ConnectionString": "Server=(localdb)\\mssqllocaldb;Database=MarketIdentity;Trusted_Connection=True;MultipleActiveResultSets=true"
}
startup.cs
public void ConfigureServices(IServiceCollection services)
{
//services.Configure<AppSettings>(Configuration.GetSection("Data:Market"));
services.AddMvc();
//app database
services.AddDbContext<EfDbContext>(
options => options.UseSqlServer(Configuration["Data:Market:ConnectionString"],
b => b.MigrationsAssembly("Market")));
//identity database
services.AddDbContext<AppIdentityDbContext>(
options => options.UseSqlServer(Configuration["Data:MarketIdentity:ConnectionString"],
b => b.MigrationsAssembly("Market")));
services.AddIdentity<IdentityUser, IdentityRole>(options => {
options.Password.RequireNonAlphanumeric = false;
options.Password.RequireUppercase = false;
options.Password.RequireLowercase = false;
options.Password.RequireDigit = false;
})
.AddEntityFrameworkStores<AppIdentityDbContext>();
}