Lambda and Expression.Call for an extension method

前端 未结 5 941
野趣味
野趣味 2021-01-17 23:08

I need to implement an expression for a method like here:

var prop = Expression.Property(someItem, \"Name\"); 
var value = Expression.Constant(someConstant);         


        
5条回答
  •  情歌与酒
    2021-01-17 23:26

    I am not sure, but you can only get an extension method from the static class using reflection. Extension methods are not truly added to the class, therefore can't be retrieved with GetMethod.

提交回复
热议问题