我正在实现 Identity 并希望自定义表名。我已成功自定义除“AspNetUsers”以外的所有表。
代码:
builder.Entity<UserProfile>(opt => opt.ToTable("IdentityUserProfile"));
builder.Entity<User>(opt => opt.ToTable("IdentityUser"));
builder.Entity<IdentityRole<int>>(opt => opt.ToTable("IdentityRole"));
builder.Entity<IdentityUserRole<int>>(opt => opt.ToTable("IdentityUserRole"));
builder.Entity<IdentityUserClaim<int>>(opt => opt.ToTable("IdentityUserClaim"));
builder.Entity<UserProfileLogin>(opt => opt.ToTable("IdentityUserProfileLogin"));
builder.Entity<IdentityUserToken<int>>(opt => opt.ToTable("IdentityUserToken"));
builder.Entity<IdentityRoleClaim<int>>(opt => opt.ToTable("IdentityRoleClaim"));
UserProfile类型继承IdentityUser,所以我想将 AspNetUsers 重命名为 IdentityUserProfile
有什么建议么??
慕少森
相关分类