How to pass parameters into an Expression tree?

c# expression-trees lambda parameters parsing

Question

I am developing the parser for expressions like this:

a1 + a2 + a3 > 0 and b <> "" or c = "source"

I want to use expression tree and collect parameters (a1, a2..) while parsing expression. How to pass parameters into an Expression tree?

Edit: I am using .net 4.0

Accepted Answer

Wrap it in a lambda that takes the parameters you're interested in. Look at the second example on: http://msdn.microsoft.com/en-us/library/bb397951.aspx




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why