views:

16

answers:

1

Sometimes when I am F5ing and in the midst of debugging, I wish to apply some LINQ ( or any other kind of operation) to a collection. Is there anything like intelligent watch windows that allows me to apply LINQ operation on a collection and show me the result?

The watch window that VS 2008 has is simply too unsophisticated for this purpose.

+1  A: 

It's not really what you are asking for but LinqPad can do ad hoc on the fly Linq queries. Unfortunately it is not linked to the VS debugger in any way so you cannot use it like a watch as you have no access to any of the variables in your code, it is just a code snippet tool. It is quite usefull for debugging Linq to SQL/Entities/XML because what you can do is set up watches on all the normal variables and then recreate your linq query in LinqPad connected to the same datasource. It is less usefull for Linq queries running against plain old collections that have been populated in code, you would have to some how recreate the collections in Linqpad in order to be able to query them.

Ben Robinson