Identity icon indicating copy to clipboard operation
Identity copied to clipboard

SqlServer Custom Identity class names

Open tessSnap opened this issue 10 years ago • 1 comments

I am using a "Database first" approach with "Users", "Roles" as my Identity tables .I am also using EF 7 MVC 6 with Web API . In my DbContext class I map the default AspNetUser class to my Custom table "Users" using modelBuilder.Entity().ToTable("Users"); But I get this error "Cannot use table 'Users' in schema '' for entity 'ApplicationUser' since it is being used for another entity" when I run the application .

tessSnap avatar Dec 12 '15 18:12 tessSnap

Found the solution . The error was a result of mapping the ApplicationUser class to entity tyoe Users as well as having a separate Users entity . After deleting the Users entity everything now works fine .

tessSnap avatar Dec 13 '15 15:12 tessSnap