Modification Default Identity Table

Step 1. Open IdentityModel.cs to add following code.

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder); // This needs to go before the other rules! modelBuilder.Entity<ApplicationUser>().ToTable("SystemUser").Property(p => p.Id).HasColumnName("UserId");
modelBuilder.Entity<ApplicationUser>().ToTable("SystemUsers").Ignore(p => p.PhoneNumber);
modelBuilder.Entity<IdentityRole>().ToTable("SystemRoles");
modelBuilder.Entity<IdentityUserRole>().ToTable("SystemUserRoles");
modelBuilder.Entity<IdentityUserLogin>().ToTable("SystemUserLogins");
modelBuilder.Entity<IdentityUserClaim>().ToTable("SystemUserClaims");
}
上一篇:Lex与Yacc学习


下一篇:【JavaScript】--- ES6/ES7/ES8