示例#1
0
 private DomainEventStreamMessage ConvertToDomainEventStream(EventStreamMessage message)
 {
     var domainEventStreamMessage = new DomainEventStreamMessage(
         message.CommandId,
         message.AggregateRootId,
         message.Version,
         message.AggregateRootTypeName,
         _eventSerializer.Deserialize<IDomainEvent>(message.Events),
         message.Items);
     domainEventStreamMessage.Timestamp = message.Timestamp;
     return domainEventStreamMessage;
 }
示例#2
0
        private DomainEventStreamMessage ConvertToDomainEventStream(EventStreamMessage message)
        {
            var domainEventStreamMessage = new DomainEventStreamMessage(
                message.CommandId,
                message.AggregateRootId,
                message.Version,
                message.AggregateRootTypeName,
                _eventSerializer.Deserialize <IDomainEvent>(message.Events),
                message.Items);

            domainEventStreamMessage.Timestamp = message.Timestamp;
            return(domainEventStreamMessage);
        }
示例#3
0
        private EventStreamMessage CreateEventMessage(DomainEventStreamMessage eventStream)
        {
            var message = new EventStreamMessage();

            message.CommandId             = eventStream.CommandId;
            message.AggregateRootTypeCode = eventStream.AggregateRootTypeCode;
            message.AggregateRootId       = eventStream.AggregateRootId;
            message.Timestamp             = eventStream.Timestamp;
            message.Version = eventStream.Version;
            message.Events  = _eventSerializer.Serialize(eventStream.Events);
            message.Items   = eventStream.Items;

            return(message);
        }
示例#4
0
        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);
        }