这same question有人问,12天后还没有得到答复...更改标识3.0表名不工作
我已经看过this它采用“ToTable”为该问题的更新。
我看过this这似乎已过时。
我想更改标识3.0表的表名 - ASP.NET Core。
到目前为止,使用“ToTable”选项(上面的第2项)更新,我设法破坏了我的锁文件,并因此破坏了项目。第三个选项已过时。
我创建了一个香草项目 - 不只是通过VS2015创建了身份3.0
我再尝试这样的变化:
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
// Customize the ASP.NET Identity model and override the defaults if needed.
// For example, you can rename the ASP.NET Identity table names and more.
// Add your customizations after calling base.OnModelCreating(builder);
builder.Entity<IdentityUser>().ToTable("MyUsers").Property(p => p.Id).HasColumnName("UserId");
builder.Entity<ApplicationUser>().ToTable("MyUsers").Property(p => p.Id).HasColumnName("UserId");
builder.Entity<IdentityRole>().ToTable("MyRoles");
}
我再检查更新的迁移,看看表的名称发生了变化,他们没有。
此刻我正在使用1.0.0-rc1-update2。
如何更改这些表的名称?
可能重复http://stackoverflow.com/questions/34523066/how-can-i-change-the-table-names -used-asp-net-identity-3-vnext – firste
是的..错过了那一个。我有这个工作,但我无法得到“builder.Entity>()。ForSqlServerToTable(”RoleClaims“);”上班。所有其他人的工作,但是当我添加它在它没有.. –
si2030