Beispiel #1
0
        private void CommitAggregateRoot(IAggregateRoot aggregateRoot)
        {
            var eventsToCommit = aggregateRoot.FlushEvents();

            if (eventsToCommit.Count() == 0)
            {
                return;
            }

            _eventStore.StoreEvents(aggregateRoot.Id, eventsToCommit);

            StoreSnapshot(aggregateRoot);
            RaiseEvents(eventsToCommit);
        }