With LINQPad, how can I display an expression tree?

expression-trees linqpad

Question

Maybe I'm missing something obvious, but I how can I view the expression tree for this query:

from word in "The quick brown fox jumps over the lazy dog".Split()
orderby word.Length
select word

using LINQPad?

1
9
11/4/2009 1:46:13 AM

Accepted Answer

You can view the objects that make up the expression tree as follows:

(from word in "The quick brown fox jumps over the lazy dog".Split().AsQueryable()
orderby word.Length
select word).Expression
10
11/6/2009 1:10:54 AM

Popular Answer

You can also use the .Dump() method available on all objects inside LinqPAD to dump an expression tree into the results window.



Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow