Save ObservableCollection to Linq for Sql
Posted by: MarkWPF
I described how you create an ObservableCollection from a Linq query (including Linq for Sql amongst others) in a previous post.
A second part of the equation is of course, how do you then save your changes back to the database using Linq?
Of course, you have probrably guessed that it’s not going to be a walk in the park.
What you need to do is go through the object and all sub lists and convert them back into the Linq EntitySet classes. After that they can be saved via SubmitChanges.
Tedious, you bet!
Either I’m missing the point somewhere or the EntityFramework needs to fix this by implementing INotifyCollectionChanged in the EntitySet class




