Exemplo n.º 1
0
        private static void ApplyEventsToSaga(IEventStream stream, ISaga saga)
        {
            foreach (var @event in stream.CommittedEvents.Select(x => x.Body))
            {
                saga.Transition(@event);
            }

            saga.ClearUncommittedEvents();
            saga.ClearUndispatchedMessages();
        }