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 }); }
public static Snapshot Snapshot(int ver, Guid entity, string tenant = "_") => new Snapshot(ver, entity, tenant, Utils.PackSnapshot(new Fixture().Create <SomeMemento>()), DateTimeOffset.Now);