Speeding up Reflection API with delegate in .NET/C#

前端 未结 5 1582
死守一世寂寞
死守一世寂寞 2021-01-02 16:08

This post has the comment if you need to call the method multiple times, use reflection once to find it, then assign it to a delegate, and then call the delegate.

5条回答
  •  轮回少年
    2021-01-02 17:01

    Isn't it obvious. You load the assembly into your app domain; create an instance of the type, and then create a delegate pointing to that instance's method...

提交回复
热议问题