我正在尝试更改.net核心标识中的所有表名,以使其更加清晰。我的ApplicationDbContext
public class ApplicationDbContext : IdentityDbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
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<ApplicationUser>().ToTable("Users");
builder.Entity<IdentityUserRole<string>>().ToTable("UserRoles");
builder.Entity<IdentityUserLogin<string>>().ToTable("UserLogins");
builder.Entity<IdentityUserClaim<string>>().ToTable("UserClaims");
builder.Entity<IdentityRole>().ToTable("Roles");
}
}
每当我进行迁移时,我仍然拥有下面的表格:
AspNetRoleClaims
AspNetUsers
AspNetUserTokens
我希望“用户”成为“用户”,而其他用户则更具可读性。我也有我的ApplicaitonUser模型
public class ApplicationUser : IdentityUser
{
}
我在做什么错了?