views:

19

answers:

1

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 me do that?

cheers

+1  A: 

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.

Adam Robinson
right, thanks adam, that makes sense. so, basically, without that method already exsitig, there's nothing I can "execute" or "eval" to get what I want? What about IronPython?
andy
or maybe the f# Interactive window?
andy
@andy: Unfortunately, no. The easiest way to be able to modify something like this at runtime is to create a simple function that performs the analysis, then pass that to the query.
Adam Robinson
cool, thanks adam. that's a shame...
andy