public object?Invoke(MethodInfo targetMethod, object?[] args) { var(callback, token, stream, otherArgs) = GetArgs(args); try { return(_call.CallAsync(targetMethod, callback, token, stream, otherArgs).Result); } catch (AggregateException e) { if (e.InnerException != null) { var edi = ExceptionDispatchInfo.Capture(e.InnerException); edi.Throw(); } throw; } }
public object Invoke(MethodInfo targetMethod, object[] args) { (Action <object> callback, CancellationToken token, Stream stream, object[] otherArgs) = GetArgs(args); token.ThrowIfCancellationRequested(); try { return(_call.CallAsync <object>(targetMethod.GetMethodInfoDto(), callback, token, stream, otherArgs).Result); } catch (AggregateException e) { if (e.InnerException != null) { var edi = ExceptionDispatchInfo.Capture(e.InnerException); edi.Throw(); } throw; } }