Answer the question
In order to leave comments, you need to log in
How to recursively decompose an expression tree?
// Creating an expression tree.
Expression<Func<int, int>> expr = num => (num * 5)+ (num * 4);
// Compiling the expression tree into a delegate.
Func<int, int> result = expr.Compile();
var r = result(4);
Answer the question
In order to leave comments, you need to log in
The right way is to use the Expression Tree Visitor: an example from MSDN . This class allows you to traverse the entire tree and even modify it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question