Exemplo n.º 1
0
 public override void InvokeMessageHandler(IMessageHandlerInvocation invocation)
 {
     using (invocation.SetupForInvocation())
     {
         _handler(invocation.Message);
     }
 }
Exemplo n.º 2
0
 public override void InvokeMessageHandler(IMessageHandlerInvocation invocation)
 {
     var handler = CreateHandler(invocation.Context);
     using (invocation.SetupForInvocation(handler))
     {
         _handleAction(handler, invocation.Message);
     }
 }
Exemplo n.º 3
0
        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);
         }
     }
 }
Exemplo n.º 5
0
        public override void InvokeMessageHandler(IMessageHandlerInvocation invocation)
        {
            Invoked = true;

            using (invocation.SetupForInvocation())
            {
                var message = invocation.Messages.OfType <IExecutableMessage>().FirstOrDefault();
                message?.Execute(invocation);
            }
        }
Exemplo n.º 6
0
        public override void InvokeMessageHandler(IMessageHandlerInvocation invocation)
        {
            Invoked = true;

            using (invocation.SetupForInvocation())
            {
                var message = invocation.Messages.ExpectedSingle() as IExecutableMessage;
                message?.Execute(invocation);
            }
        }
Exemplo n.º 7
0
        public override void InvokeMessageHandler(IMessageHandlerInvocation invocation)
        {
            Invoked = true;
            if (InvokeMessageHandlerCallback == null)
                return;

            using (invocation.SetupForInvocation())
            {
                InvokeMessageHandlerCallback(invocation);
            }
        }
Exemplo n.º 8
0
        public override void InvokeMessageHandler(IMessageHandlerInvocation invocation)
        {
            Invoked = true;
            if (InvokeMessageHandlerCallback == null)
            {
                return;
            }

            using (invocation.SetupForInvocation())
            {
                InvokeMessageHandlerCallback(invocation);
            }
        }
Exemplo n.º 9
0
 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));
     }
 }
Exemplo n.º 10
0
 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);
                    }
                }
            }
        }