Expression Tree Creation and ExpressionTree Convert Type
lets say i have :
anything.where(x=>x.age == int.parse(txtage.text));
now i know that int.parse(txtage.text)
is an expression of type ExpressionType.Convert
now i wanna know how to create an expression of type ExpressionType.Convert manually (programatically)
why ?
because im passing expressions between layers and changing the type of it , i managed make a visit to every exp开发者_JS百科ression and rebuild it except for
case ExpressionType.Convert:
any idea ? thanks in advance.
No, int.Parse(txtage.text)
is a method call, not a conversion expression. You'd build it using Expression.Call
.
However, if you do want to build a conversion expression, use Expression.Convert
.
精彩评论