LINQ-To-SQL and Many-To-Many Relationship Deletions
- by Jake
I have a many-to-many relationship between two tables, let's say Friends and Foods. If a friend likes a food I stick a row into the FriendsFoods table, like this:
ID Friend Food
1 'Tom' 'Pizza'
FriendsFoods has a Primary Key 'ID', and two non-null foreign keys 'Friend' and 'Food' to the 'Friends' and 'Foods' tables, respectively.
Now suppose I…