Ejemplo n.º 1
0
 public static Task Remove(
     this ISnapshotStore snapshots,
     string aggregateId
     )
 {
     return(snapshots.Remove(aggregateId, 0, long.MaxValue, CancellationToken.None));
 }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
 public static Task Remove(
     this ISnapshotStore snapshots,
     string aggregateId,
     long fromVersionInclusive,
     long toVersionInclusive
     )
 {
     return(snapshots.Remove(aggregateId, fromVersionInclusive, toVersionInclusive, CancellationToken.None));
 }
Ejemplo n.º 4
0
        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);
        }