I have a database with a Users table, and users can have friends. Users create content in my Content table, which has a UserId as a foreign key. So far everything is good. Entity Framework creates 2 entities - one for Users and one for Content. And the Users entity has navigation to contents collection (ont user can have many Content records).
I've created another new table so users can "Like" content. So I have ContentLikes table which has a UserId (as a foreign key for the users table), and I have a ContentId (as a foreign key for the contents table). My problem is that Entity Framework doesn't map those objects in any way - I don't see entity for likes or a navigation property in the contents entity.
When i try to add that table EF says it is already mapped.
What am I missing here?
I see the following in the errors:
Error 6004: The table 'ContentLikes' is referenced by a relationship, but cannot be found.
Check whether the foreign table and 'ContentLikes' table of column both same datatype and allow nulls. After long time i found the solution for this issue and now working fine.