首页 > 其他 > 详细

Modification Default Identity Table

时间:2017-03-13 12:51:17      阅读:183      评论:0      收藏:0      [点我收藏+]

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

原文:http://www.cnblogs.com/Javi/p/6541870.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!