Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use table 'AspNetRoles' for entity type 'AspNetRoles' since it is being used for entity type 'IdentityRole' #17

Open
Husseinelghoul opened this issue Jan 17, 2021 · 0 comments

Comments

@Husseinelghoul
Copy link

The full error message:

InvalidOperationException: Cannot use table 'AspNetRoles' for entity type 'AspNetRoles' since it is being used for entity type 'IdentityRole' and there is no relationship between their primary keys.

Each time I am trying to access the database using Entity FrameWork Core to read/write data I am getting this exception. The code generating the exception could be as simple as
var p = _context.Platforms.Where(c=> c.PlatformId == 1);

I am using Identity and my database context is inheriting from IdentityDbContext<AspNetUsers>

I am using Entity Framework Core 2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant