public static class MethodProxyEx
{
private static readonly ConcurrentDictionary<string, Delegate> _methodCache;
static MethodProxyEx()
{
_methodCache = new ConcurrentDictionary<string, Delegate>();
}
public static OutType GetMethodProxy<OutType>(this object target, string methodName) where OutType : Delegate
=> (OutType)target.GetMethodDelegate<OutType>(methodName);
public static Delegate GetMethodDelegate<OutType>(this object target, string methodName) where OutType : Deleg
C# 反射类的方法(普通反射+emit)
于 2024-12-11 16:15:19 首次发布