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