Is it possible to query an Object graph using LINQ during debug in Visual Studio 2010
I know that in the Immed and Watch windows you can't use Lambda expressions.
So, say I'm in Debug mode, and I've got an Object in my Watch window.
I'd like to be to say: "show me all properties in this tree of DateTime type", using LINQ.
Is there any Debug feature or add-on in VS2010 that will let m开发者_运维技巧e do that?
cheers
Using LINQ and using lambdas are two different issues, though they're usually used in combination. Strictly speaking, you could use a LINQ query as long as you pass it a delegate to an existing method. This is true of any of the facilities that dynamically execute code.
Lambdas are not usable in any of the windows, as lambdas are just syntactic sugar that the compiler uses to create new functions and, in some cases, types. Since those items cannot be added dynamically (or, more accurately, the IDE doesn't support doing that), lambdas can't be created or modified at runtime, even in the dynamic execution windows.
精彩评论