Exemplo n.º 1
0
        protected async Task <TState> Run(TState initialState, IContext context)
        {
            TState                 s        = initialState;
            IEventCriteria         criteria = _store.CreateCriteria(_ => { });
            IEventStoreTransaction tx       = context
                                              .Get <IServiceProvider>()
                                              .GetRequiredService <IEventStoreTransaction>();

            IAsyncEnumerable <RecordedEvent> events = await tx.Get(criteria);

            await events.ForEach(re => {
                Handle(s, re);
                return(Task.CompletedTask);
            });

            return(s);
        }