Example #1
0
        public async Task Store(int entityVersion, Guid entityId, object memento, string tenantId = EventStore.DefaultTenant)
        {
            var snapshot = new Snapshot(entityVersion, entityId, tenantId, Utils.PackSnapshot(memento), DateTimeOffset.Now);

            EventStore.Logger.Debug("Storing snapshot {@snapshot}", snapshot);
            await _store.Store(snapshot).ConfigureFalse();

            EventStore.Logger.Debug("Snapshot for {@entity} stored successfully", new{ entityId, tenantId, entityVersion });
        }
Example #2
0
 public static Snapshot Snapshot(int ver, Guid entity, string tenant = "_")
 => new Snapshot(ver, entity, tenant, Utils.PackSnapshot(new Fixture().Create <SomeMemento>()), DateTimeOffset.Now);