I am a Linq to SQL newbie and I noticed, when I query the database for a result set and store it directly as a List ( using ToList() directly), when I make changes to the list items, those changes persist into the database after I do the SubmitChanges().
Somehow, I always thought ToList() gets me a copy, not the actual set itself. Can someone please expand on this, specifically, I couldn’t find any links on ‘updating the database using Linq to SQL’ vs ‘getting a true copy of result set from the database’.
In other words, if I want a result set which can be editable but not have an affect on the database, what’s the approach?
How do I get a true ‘independent’ copy of a rowset?
ToList() apparently is no good, within the scope of the datacontext. Changes to the list items will still be tracked and persisted on submitchanges(). The only way to get a true copy looks like is to do a manual loop-over-and-copy properties