예제 #1
0
        /// <summary>
        ///   Save all uncommited events from a specific aggregate root.
        /// </summary>
        /// <param name = "source">
        ///   The aggregate root for which all uncommited events should be saved.
        /// </param>
        public IEnumerable <IEvent> Save(IEventSource source)
        {
            var uncommittedEvents = source.GetUncommittedEvents();

            SaveEvents(source.Id, source.UncommittedVersion, uncommittedEvents);

            source.AcceptChanges();

            return(uncommittedEvents);
        }