开发者

LINQ Query On The Fly Evaluation When Debugging

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 t开发者_运维技巧his purpose.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜