I\'ve used ASP.net membership for years and am just starting to try out ASP.net Identity. They just released version 2.0 and which is supposed to support int
pr
In the IdentityModel.cs file, I added the following code to the ApplicationDbContext
class
Notice the Model names are different that that names listed in the accepted answer
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<ApplicationUser>().ToTable("SystemUsers");
modelBuilder.Entity<IdentityRole>().ToTable("SystemRoles");
modelBuilder.Entity<IdentityUserRole>().ToTable("SystemUserRoles");
modelBuilder.Entity<IdentityUserLogin>().ToTable("SystemUserLogins");
modelBuilder.Entity<IdentityUserClaim>().ToTable("SystemUserClaims");
}
Grrr...... So after wasting a couple hours on this, I copied my rules and pasted them below the base.OnModelCreating(modelBuilder);
line and everything worked properly. I didn't realize that the base method needed to be called first :(
Everything is working properly now using the following configuration:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder); // This needs to go before the other rules!
modelBuilder.Entity<User>().ToTable("Users");
modelBuilder.Entity<Role>().ToTable("Roles");
modelBuilder.Entity<UserRole>().ToTable("UserRoles");
modelBuilder.Entity<UserLogin>().ToTable("UserLogins");
modelBuilder.Entity<UserClaim>().ToTable("UserClaims");
}