public void Execute(OnDeserializeMessage pipelineEvent)
        {
            Guard.AgainstNull(pipelineEvent, nameof(pipelineEvent));

            var state          = pipelineEvent.Pipeline.State;
            var transportFrame = state.Get <TransportFrame>(StateKeys.TransportFrame);

            Guard.AgainstNull(transportFrame, nameof(transportFrame));

            var data = transportFrame.Message;

            using (var stream = new MemoryStream(data, 0, data.Length, false, true))
            {
                state.Replace(StateKeys.Message,
                              _serializer.Deserialize(Type.GetType(transportFrame.AssemblyQualifiedName, true, true), stream));
            }
        }
        public void Execute(OnDeserializeMessage pipelineEvent)
        {
            var state = pipelineEvent.Pipeline.State;

            Guard.AgainstNull(state.GetTransportMessage(), "transportMessage");
            Guard.AgainstNull(state.GetWorkQueue(), "workQueue");
            Guard.AgainstNull(state.GetErrorQueue(), "errorQueue");

            var transportMessage = state.GetTransportMessage();

            object message;

            try
            {
                var data = transportMessage.Message;
                using (var stream = new MemoryStream(data, 0, data.Length, false, true))
                {
                    message = _serializer.Deserialize(Type.GetType(transportMessage.AssemblyQualifiedName, true, true),
                                                      stream);
                }
            }
            catch (Exception ex)
            {
                transportMessage.RegisterFailure(ex.AllMessages(), new TimeSpan());

                state.GetErrorQueue().Enqueue(transportMessage, _serializer.Serialize(transportMessage));
                state.GetWorkQueue().Acknowledge(state.GetReceivedMessage().AcknowledgementToken);

                state.SetTransactionComplete();
                pipelineEvent.Pipeline.Abort();

                _events.OnMessageDeserializationException(this,
                                                          new DeserializationExceptionEventArgs(
                                                              pipelineEvent,
                                                              state.GetWorkQueue(),
                                                              state.GetErrorQueue(),
                                                              ex));

                return;
            }

            state.SetMessage(message);
        }