Entity framework many to many relationship association not automatically generated

73 views Asked by At

I've seen this post, my problem is quite the opposite, EF is treating the entities as two separate 1 to many relation, so the User have many UserInRole, and the Role also have many UserInRole entities, shouldn't EF automatically hide the UserInRole table and give a navigation property Roles for User and Users for Role. What I want is actually this:

ef model

1

There are 1 answers

0
Omar Mneimneh On BEST ANSWER

Deleting the entity from the edmx and updating changes fixed it, apparently when I updated the model from the database in the edmx designer it kept columns that I removed from the database maybe because it was referenced somewhere else in the project, anyway I deleted the entire entity manually and updated the changes / re-added the missing tables and it did the trick.