protected virtual Task OnInvokingAsync( Message message, CancellationToken?cancellationToken = default) { return(Invoking.InvokeAsync( this, new MessageInvokingAsyncEventArgs(message, cancellationToken: cancellationToken))); }
public static void OnInvoking(ApiInvokingArgs args) { try { Invoking?.Invoke(null, args); } catch (Exception ex) { throw new ApiInvocationException("Handling Api Invoking event failed.", ex); } }