/// <summary> /// 泛型类型函数调用 /// </summary> /// <param name="remoteType">调用代理类型</param> /// <param name="methodName">调用函数名称</param> /// <param name="methodGenericTypes">方法泛型参数集合</param> /// <param name="parameters">调用参数</param> /// <returns>函数返回值</returns> public static object InvokeGenericTypeMethod(fastCSharp.code.remoteType remoteType, string methodName, fastCSharp.code.remoteType[] methodGenericTypes, params object[] parameters) { return getGenericTypeMethod(remoteType, methodName).MakeGenericMethod(methodGenericTypes.getArray(value => value.Type)).Invoke(null, parameters); }
/// <summary> /// 泛型方法调用 /// </summary> /// <param name="method">泛型方法信息</param> /// <param name="types">泛型参数类型集合</param> /// <param name="parameters">调用参数</param> /// <returns>返回值</returns> public static object InvokeGenericMethod(MethodInfo method, fastCSharp.code.remoteType[] types, params object[] parameters) { if (method == null) fastCSharp.log.Error.Throw(fastCSharp.log.exceptionType.Null); return method.MakeGenericMethod(types.getArray(value => value.Type)).Invoke(null, parameters); }