Mar 31, 2014 at 1:01 PM
Edited Mar 31, 2014 at 1:02 PM
Before Identity 2.0 I had implemented 1.0 and implemented all of the classes I needed from the interfaces provided in the .Core library. I'm trying to use more of your implementation this go 'round and am trying to use the .EntityFramework implementations.
I've noticed that the IdentityUser class has a navigation property mapping to the IdentityUserRole class which is only a link table in the database. Is this needed? Couldn't this be handled through foreign keys and just mapped out in a EF configuration mapping?
This is how I had it set up previously with my implementation of it.
It seems odd and cumbersome to try and access the Roles from the User class by typing User.Roles.Role.Name to get the role name. It would be much easier to just have User.Roles.Name. It is also much clearer and easier to understand.
From the Role EFconfiguration you should have:
this.HasMany(t => t.Users)
.WithMany(t => t.Roles)