I am trying to extend the IdentityUser class:
public class User : IdentityUser
{
public Address Address { get; set; }
}//end of class User
here is my DbContext class:
public class MembershipContext : IdentityDbContext<User>
{
protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)
{
modelBuilder.ComplexType<Address>();
modelBuilder.Entity<IdentityUserRole>().HasKey(x => x.RoleId);
modelBuilder.Entity<IdentityUserLogin>().HasKey(x => x.ProviderKey);
}
}//end of class MembershipContext
When Ef Generates the tables in the IdentityUserRoles table it creates a RoleId column, a UserId column and a IdentityRole_Id column, which when a user is add to a role
the RoleId and IdentityRole_Id have the same value. If I remov ...
Go to the complete details ...