示例#1
0
 // Hydrating
 internal void Hydrate(IEnumerable <Event> events)
 {
     foreach (var @event in events)
     {
         aggregate.ApplyEvent(@event.Replay());
     }
     aggregate.ClearPendingEvents();
     LastCommittedVersion = CurrentVersion;
 }
示例#2
0
        public void Init()
        {
            Aggregate = CreateAggregate();

            var domainEvents = Given().ToList();

            if (domainEvents.Any())
            {
                foreach (var e in domainEvents)
                {
                    Aggregate.ApplyEvent(e);
                }

                ClearUncommittedEvents();
            }

            When();
        }