/// <summary>
        /// Inserts a new snapshot
        /// </summary>
        /// <param name="snapshot">Snapshot instance</param>
        public void InsertSnapshot(SnapshotDetail snapshot)
        {
            var existing   = GetSnapshot(snapshot.AggregateRootId);
            var collection = GetDatabase(_snapshotConnectionStringName, _snapshotDatabaseName).GetCollection <SnapshotDetail>("Snapshots");

            if (existing != null)
            {
                snapshot.Id = existing.Id;
            }

            collection.Save(snapshot);
        }
Beispiel #2
0
        /// <summary>
        /// Inserts a new snapshot
        /// </summary>
        /// <param name="snapshot">Snapshot instance</param>
        public void InsertSnapshot(SnapshotDetail snapshot)
        {
            var existing = GetSnapshot(snapshot.AggregateRootId);
            var collection = GetDatabase(_snapshotConnectionStringName, _snapshotDatabaseName).GetCollection<SnapshotDetail>("Snapshots");

            if (existing != null)
            {
                snapshot.Id = existing.Id;
            }

            collection.Save(snapshot);
        }