I have an EF4 model over a SQL Server 2008 db. In my model I have a many to many relationship:
Articles * - * Comments
and
Projects * - * Comments
In my Model, I simply created an association and set it up to many to many. In my db, I then get two additional tables ArticleComments and ProjectComments, which only hold the primarykeys to each table.
Problem is that when I delete a comment from an Article in my code (using article.Comments.Remove([some comment entity]) it only deletes the row from ArticleComments, and not the actual Comment it self.
Any solutions to this?
I've thought about setting it up as a trigger ondelete in the ProjectComments-table, but I feel this should be possible using only the Entity Framework 4 stuff.