Yeah this stuff just doesn't work well with LINQ to SQL. The problem is that entities are tracked EVEN IF YOU CREATE A BRAND NEW INSTANCE of an entity. So even reloading an entity in many cases causes actually the same instance to be loaded up.
Attach and Detach doesn't really work for anything but single level instances in LINQ to SQL.
The trick is to stick with the single DataContext concept and deal with an entity at a time and completely dispose the context if you need new instances on the same thread to ensure you're getting completely cleean instances.
Funky. It needs to stop trying to be so "helpful".
Right - disconnected with Linq to SQL unfortunately is not really a workable solution unless you manually update all children that have changed.
Luckily most scenarios work just fine in connected mode and for that L2S works very well.
+++ Rick ---
| Rick Strahl West Wind Technologies Where do you want to surf today? | Reader Version: 5.0 |
from Maui, Hawaii
