In my generated LINQ to SQL classes, I have classes containing EntitySets.
Everything looks great until I need to modify the EntitySet (add, remove some relationships). I thought it would work by doing something like:
User.Actions = newUserActions; //This is how I used it with NHibernate
Then, when I try to make changes, I can get a duplicate key exception, which means that it does not clear the old actions before assigning new ones, and some of them can be repeated; Do I need to do this manually?
What is the best way to do this (update EntitySet)? Suggestions?
Thnx
source
share