public override void InvokeMessageHandler(IMessageHandlerInvocation invocation) { using (invocation.SetupForInvocation()) { _handler(invocation.Message); } }
public override void InvokeMessageHandler(IMessageHandlerInvocation invocation) { var handler = CreateHandler(invocation.Context); using (invocation.SetupForInvocation(handler)) { _handleAction(handler, invocation.Message); } }
public override void InvokeMessageHandler(IMessageHandlerInvocation invocation) { var handler = CreateHandler(invocation.Context); using (invocation.SetupForInvocation(handler)) { _handleAction(handler, invocation.Messages[0]); } }
public override void InvokeMessageHandler(IMessageHandlerInvocation invocation) { using (invocation.SetupForInvocation()) { foreach (var message in invocation.Messages) { _handler(message); } } }
public override void InvokeMessageHandler(IMessageHandlerInvocation invocation) { Invoked = true; using (invocation.SetupForInvocation()) { var message = invocation.Messages.OfType <IExecutableMessage>().FirstOrDefault(); message?.Execute(invocation); } }
public override void InvokeMessageHandler(IMessageHandlerInvocation invocation) { Invoked = true; using (invocation.SetupForInvocation()) { var message = invocation.Messages.ExpectedSingle() as IExecutableMessage; message?.Execute(invocation); } }
public override void InvokeMessageHandler(IMessageHandlerInvocation invocation) { Invoked = true; if (InvokeMessageHandlerCallback == null) return; using (invocation.SetupForInvocation()) { InvokeMessageHandlerCallback(invocation); } }
public override void InvokeMessageHandler(IMessageHandlerInvocation invocation) { Invoked = true; if (InvokeMessageHandlerCallback == null) { return; } using (invocation.SetupForInvocation()) { InvokeMessageHandlerCallback(invocation); } }
public override Task InvokeMessageHandlerAsync(IMessageHandlerInvocation invocation) { try { var handler = CreateHandler(_container, invocation.Context); using (invocation.SetupForInvocation(handler)) { return(_handleAction(handler, invocation.Messages[0])); } } catch (Exception ex) { return(Task.FromException(ex)); } }
public override Task InvokeMessageHandlerAsync(IMessageHandlerInvocation invocation) { try { var handler = CreateHandler(_container, invocation.Context); using (invocation.SetupForInvocation(handler)) { return _handleAction(handler, invocation.Message); } } catch (Exception ex) { return TaskUtil.FromError(ex); } }
public override async Task InvokeMessageHandlerAsync(IMessageHandlerInvocation invocation) { Invoked = true; using (invocation.SetupForInvocation()) { foreach (var message in invocation.Messages) { (message as IExecutableMessage)?.Execute(invocation); var asyncTask = (message as IAsyncExecutableMessage)?.ExecuteAsync(invocation); if (asyncTask != null) { await asyncTask.ConfigureAwait(false); } } } }