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 )); }
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); }
private EventData EventData(IPendingEvent pendingEvent) { var data = pendingEvent.Data(_serializer); return(new EventData(pendingEvent.Id, pendingEvent.Type, true, data, null)); }