private DomainEventStreamMessage ConvertToDomainEventStream(EventStreamMessage message)
        {
            var domainEventStreamMessage = new DomainEventStreamMessage(
                message.CommandId,
                message.AggregateRootId,
                message.Version,
                message.AggregateRootTypeName,
                _eventSerializer.Deserialize <IDomainEvent>(message.Events),
                message.Items)
            {
                Id        = message.Id,
                Timestamp = message.Timestamp
            };

            return(domainEventStreamMessage);
        }
        private EventStreamMessage CreateEventMessage(DomainEventStreamMessage eventStream)
        {
            var message = new EventStreamMessage
            {
                Id                    = eventStream.Id,
                CommandId             = eventStream.CommandId,
                AggregateRootTypeName = eventStream.AggregateRootTypeName,
                AggregateRootId       = eventStream.AggregateRootId,
                Timestamp             = eventStream.Timestamp,
                Version               = eventStream.Version,
                Events                = _eventSerializer.Serialize(eventStream.Events),
                Items                 = eventStream.Items
            };

            return(message);
        }