0

If i have a sq-table relation model that looks like this:

Project <----> ProjectActivity <----> Activity

Where Project and Activity has many to many connections via ProjectActivity and i want to remove a ProjectActivity (not just set its Projekt FK to null). How to i do this?

If I on the EntitySet takes Project.ProjectActivities.Clear(); the relation will be deletet but the ProjectActivity row will still be there with null reference to Project.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Andreas
  • 6,958
  • 10
  • 38
  • 52

1 Answers1

1
dataContext.ProjectActivities.DeleteAllOnSubmit(Project.ProjectActivities); 

that should work, you have to delete them not just clear relations

Kris Ivanov
  • 10,476
  • 1
  • 24
  • 35