After disposing my datacontext, linq still holds data for other separate calls with new datacontext to those entities. Shouldnt this have been been cleared?
A:
You might be holding a reference to one of the entities. They internally point to the DataContext. If that is the case, you are looking how to change the context of the entities, regardless of what you are trying to free with dispose. Disclaimer: I don't know if dispose is supposed to clear the tracked entities list, but that would be awfull if you hold a reference to those entities.
eglasius
2009-03-05 22:13:28
Entities don't actually hold a reference to the DataContext - check the .designer.cs file your .dbml generates: they are just `INotifyProperty*` implementers with `[Table]` and `[Column]` attributes and some partial methods for extension points.
Simon Buchan
2010-01-06 09:16:23