When I step through code and get to a linq statement, the stepping through process and the lines which are evaluated (and their order) are not the same as the code is written. I know this is to do with commands like yield etc.
My questions are:
- What do I need to learn to understand why the code is debugged in the way it is (with Linq statements)?
- What stepping through techniques are there for Linq statements?
Oh, and I use Visual Studio 2010 Ultimate.
According to MSDN
Any query that compiles to an expression tree produces code that is beyond the control of the debugger.So you won’t be able to fully debug the Linq query through Visual Studio Debugger.
But
there are few tool which can help for example
Linq PadThis page also describes some techniques that can be used for debugging Linq statements
This is another detailed article about debugging Linq