public static MethodInfo GetGeneric <TAct>(this object obj, TAct act, params Type[] types) { MethodInfo methodInfo = new MethodOf <TAct>(act); var genMethod = methodInfo.GetGenericMethodDefinition(); var constructedMethod = genMethod.MakeGenericMethod(types); return(constructedMethod); }
public static TAct Call <TAct>(this object obj, TAct act) { MethodInfo methodInfo = new MethodOf <TAct>(act); return(methodInfo.CreateDelegate <TAct>(obj)); }