How may parameters be sent 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

1
1
4/20/2011 9:13:42 AM

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

0
4/20/2011 9:38:17 AM


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