コード例 #1
0
        private StoredEvent ToStoredEvent(string stream, IPendingEvent pendingEvent, long eventNumber)
        {
            var data     = pendingEvent.Data(_serializer);
            var metadata = _metadataFactory.MetadataFor(pendingEvent.Id, pendingEvent.Type, data, _serializer);
            var created  = _clock.UtcNow;

            return(new StoredEvent(
                       pendingEvent.Id,
                       stream,
                       pendingEvent.Type,
                       eventNumber,
                       data,
                       metadata,
                       created
                       ));
        }
コード例 #2
0
        private RecordedEventDocument RecordedEvent(
            string category,
            string stream,
            IPendingEvent pendingEvent,
            long eventNumber
            )
        {
            var e = new RecordedEventDocument();

            e.Stream      = stream;
            e.EventId     = pendingEvent.Id;
            e.EventType   = pendingEvent.Type;
            e.EventNumber = eventNumber;
            e.Created     = UtcNow;
            e.Data        = pendingEvent.Data(_serializer);
            e.Metadata    = pendingEvent.Metadata(_metadataFactory, _serializer);
            e.Category    = category;
            return(e);
        }
コード例 #3
0
        private EventData EventData(IPendingEvent pendingEvent)
        {
            var data = pendingEvent.Data(_serializer);

            return(new EventData(pendingEvent.Id, pendingEvent.Type, true, data, null));
        }