static BeginMethodHandler() { try { var dynMethod = IntegrationMapper.CreateBeginMethodDelegate(typeof(TIntegration), typeof(TTarget), new[] { typeof(TArg1), typeof(TArg2), typeof(TArg3) }); if (dynMethod != null) { _invokeDelegate = (InvokeDelegate)dynMethod.CreateDelegate(typeof(InvokeDelegate)); } } catch (Exception ex) { throw new CallTargetInvokerException(ex); } finally { if (_invokeDelegate is null) { _invokeDelegate = (instance, arg1, arg2, arg3) => CallTargetState.GetDefault(); } } }
static BeginMethodHandler() { try { var dynMethod = IntegrationMapper.CreateBeginMethodDelegate(typeof(TIntegration), typeof(TTarget), Array.Empty <Type>()); if (dynMethod != null) { _invokeDelegate = (InvokeDelegate)dynMethod.CreateDelegate(typeof(InvokeDelegate)); } } catch (Exception ex) { throw new CallTargetInvokerException(ex); } finally { if (_invokeDelegate is null) { _invokeDelegate = instance => CallTargetState.GetDefault(); } } }