首页 > 代码库 > Modification Default Identity Table

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");
        }

 

Modification Default Identity Table