public static Task Remove( this ISnapshotStore snapshots, string aggregateId ) { return(snapshots.Remove(aggregateId, 0, long.MaxValue, CancellationToken.None)); }
/// <summary> /// 删除聚合相关的事件。 /// </summary> public void Remove(Type aggregateType, object aggregateId) { int aggregateRootTypeCode = _typeCodeProvider.GetTypeCode(aggregateType); var aggregateRootId = aggregateId.ToString(); _snapshotStore.Remove(aggregateRootId, aggregateRootTypeCode); _eventStore.RemoveAll(aggregateRootId, aggregateRootTypeCode); }
public static Task Remove( this ISnapshotStore snapshots, string aggregateId, long fromVersionInclusive, long toVersionInclusive ) { return(snapshots.Remove(aggregateId, fromVersionInclusive, toVersionInclusive, CancellationToken.None)); }
public async Task snapshots_can_be_deleted() { var input = new SnapshotInfo("Aggregate_1", 1, new State(), 1); await _snapshots.Add("Aggregate_1", input); await _snapshots.Remove("Aggregate_1"); var tape = new Recorder(); await Store.ReadForwardAsync("Aggregate_1", 0, tape); Assert.True(tape.IsEmpty); }