Reputation: 327
I have an MVC5 application using Entity Framework 6.1 and Asp.Net Identity 2 and have data migrations enabled. I have used sample code from other answers on StackExchange to seed the Role and User tables. My application data context is based on IdentityDbContext. On issuing an update-database command, my database is created and populated with the following tables:
My app launches OK, but when I try to log in using the seeded user (or any user for that matter), I get the following error:
How can I get SignInManager to reference the IdentityUsers table instead of AspNetUsers?
Upvotes: 2
Views: 7928
Reputation: 1054
You can set custom names in OnModelCreating
protected override void OnModelCreating(DbModelBuilder mb)
{
base.OnModelCreating(mb);
mb.Entity<User>().ToTable("IdentityUsers");
...
}
Upvotes: 3