Exemplo n.º 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
                       ));
        }
Exemplo n.º 2
0
 /// <inheritdoc />
 public byte[]? Metadata(IMetadataFactory factory, IJsonEventSerializer serializer) =>
 factory.MetadataFor(Id, _type, _data, serializer);