public SnapshotDocument Serialize(IUncommittedSnapshot serializedSnapshot) { var id = serializedSnapshot.Metadata.GetValue(MetadataKeys.SnapshotId, value => Guid.Parse(value.ToString())); var data = BsonDocumentWrapper.Create(serializedSnapshot.Data); var metadata = BsonDocument.Create(serializedSnapshot.Metadata); var snapshot = new SnapshotDocument { Id = id, Timestamp = DateTime.UtcNow, AggregateId = serializedSnapshot.AggregateId, Version = serializedSnapshot.AggregateVersion, Data = data, Metadata = metadata, }; return(snapshot); }
public async Task SaveSnapshotAsync(IUncommittedSnapshot uncommittedSnapshot) { await _store.SaveSnapshotAsync(uncommittedSnapshot).ConfigureAwait(false); Verifier.CalledMethods |= EventStoreMethods.SaveSnapshotAsync; }
public Task SaveSnapshotAsync(IUncommittedSnapshot snapshot) { _uncommittedSnapshots.Add(snapshot); return(Task.CompletedTask); }