Adding a node/property to an Expression Tree

前端 未结 1 1336
情话喂你
情话喂你 2021-01-05 22:22

This is the first time I\'ve really dealt with Expression Trees, and I am a bit lost. I apologise if this question just doesn\'t make any sense at all. Consider the followin

1条回答
  •  别那么骄傲
    2021-01-05 23:16

    Sure; if you have baseExpression, then something like:

    var valExpression = Expression.Lambda>(
        Expression.PropertyOrField(baseExpression.Body, "Value"),
        baseExpression.Parameters);
    var updateExpression = Expression.Lambda>(
        Expression.PropertyOrField(baseExpression.Body, "Update"),
        baseExpression.Parameters);
    

    0 讨论(0)
提交回复
热议问题