コード例 #1
0
        public async Task <ISnapshot?> GenerateAsync(
            CancellationToken?cancellationToken = default,
            ulong?target = default)
        {
            IEventReconciler reconciler = CreateEventReconciler(
                out Func <Task <IEnumerable <EventCentricAggregateRoot> > > aggregates);

            ulong?current = await reconciler
                            .ReconcileAsync(
                cancellationToken : cancellationToken,
                target : target)
                            .ConfigureAwait(false);

            if (current.HasValue)
            {
                var sequence = new EventSequence(current.Value);

                IEnumerable <EventCentricAggregateRoot> values = await aggregates()
                                                                 .ConfigureAwait(false);

                return(new Snapshot(values, sequence));
            }

            return(default);
コード例 #2
0
 private void ReconcileEvents(IEventSequence?previous, IEventSequence?target)
 {
     _ = eventReconciler.ReconcileAsync(previous: previous?.Sequence, target: target?.Sequence);
 }