How do I force LINQPad to give me a non-cached result from a LINQ2SQL query?
The scenario is this:
1) examine some data (from a in MyThings where … select a).First();
2) modify data outside LINQPad immediately after (service call)
3) re-examine some data (from a in MyThings where … select a).First();
It seems to be caching results. :-/
LINQPad instantiates a fresh DataContext each time you hit F5, so there’s no chance of caching between query runs. However, if you dump twice in the same query, the second result will cache:
This is by virtue of LINQ to SQL’s object tracking. You can disable it by switching object tracking off – just as you would ordinarily: