Kiran Rani
Kiran Rani

Reputation: 164

System.InvalidOperationException: Cannot use table x for entity type y

Microsoft.EntityFrameworkCore.Relational: Cannot use table x for entity type y since it is being used for entity type x and there is no relationship between the primary key of x and the primary key of y.

Upvotes: 2

Views: 5764

Answers (1)

Kiran Rani
Kiran Rani

Reputation: 164

In my case, I accidentally used the same name for 2 tables (TableAttribute) while defining the schema in the data layer. Fixing the naming fixed this issue.

Upvotes: 11

Related Questions