How to call the method from a MethodCallExpression in c#

后端 未结 5 1696
生来不讨喜
生来不讨喜 2020-12-29 06:33

I have a method call expression and try to invoke the method. I figured out a way, but I have problems in retrieving the parameter values since not every argument is describ

5条回答
  •  佛祖请我去吃肉
    2020-12-29 06:55

    Compiling an expression is a very intensive operation, so I would only do that if you are planning on re-using the expression. I would recommend the reflection way otherwise; you will find it executes faster. Never call expression.Compile() in a tight loop.

提交回复
热议问题