1

My question is almost the exact same as the question here but with a slight twist.

In entity framework code first how would one create a many to many relationship (such as a twitter style user has users who follow them and in turn the same user can follow a list of users) but also store an extra column (e.g. FollowedDate) on the join table?

I imagine the resulting tables would look something like below but I'm not sure of how the code first model would fit together.

user
------------------
|  id | Username |
------------------

join table
--------------------------------------------------------
| followerUserId | followingUserId | followedTimestamp |
--------------------------------------------------------
Community
  • 1
  • 1
carrot_programmer_3
  • 915
  • 3
  • 14
  • 28
  • Unfortunately I'm not sure you can do that in a straightforward way (but you can work around it): http://stackoverflow.com/questions/7404573/how-to-add-a-column-to-a-link-table-with-code-first, http://stackoverflow.com/questions/7289160/ef-code-first-additional-column-in-join-table-for-ordering-purposes – Chris Aug 28 '13 at 17:38

0 Answers0