ID 3.0 テーブル - ASP.NET Core のテーブル名を変更したい。
これまでのところ、「ToTable」オプション (上記 2 番) の更新を使用して、ロックファイルを破損し、結果としてプロジェクトを破損しました。3 番目のオプションは時代遅れです。
バニラ プロジェクトを作成しました - ID 3.0 で VS2015 を介して作成された変更はありません
次に、これを試しました:
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 を使用しています。
これらのテーブルの名前をどのように変更しますか?