Пример #1
0
 public static CosmosStream ToCosmosStream(this StreamDocument document, IEnumerable <EventDocument> eventDocs) =>
 CosmosStream.Create(document.OriginalId, document.Type,
                     new Core.Version(document.Version).WithMetaData(document.Etag),
                     StreamReadStatus.Success,
                     ReadDirection.Forward,
                     eventDocs.Select(e => CosmosEvent.Create(e.StreamId, e.OriginalId, e.Position, e.Type, e.Data, e.EventMetadata, DateTime.Now))
                     .ToArray());
Пример #2
0
 public static CosmosEvent ToCosmosEvent(this EventDocument document) =>
 CosmosEvent.Create(document.StreamId, document.OriginalId, document.Position, document.Type,
                    document.Data, document.EventMetadata, DateTime.Now);