public void PostCommit(Commit committed)
 {
     foreach (var @event in committed.Events)
     {
         Debug.WriteLine(@event.Body.ToString());
         PersistedDomainEvent evt = new PersistedDomainEvent();
         evt.CommitSequence = committed.CommitSequence;
         evt.Timestamp = committed.CommitStamp;
         evt.EventType = @event.Body.GetType().FullName;
         evt.DomainEvent = (DomainEvent) @event.Body;
         evt.StreamId = committed.StreamId;
         evt.CommitId = committed.CommitId;
         _rawEventStore.SaveEvent(evt);
     }
 }
        public void Verify_basic_save_of_an_event()
        {
            Dea a = new Dea() { Paperoga = "Yes", Test = 2 };
            Deb b = new Deb() { BlaBlaList = new List<String>() { "one", "two", "three" }, Number = 34.5 };

            PersistedDomainEvent evta = new PersistedDomainEvent()
            {
                CommitSequence = 1,
                DomainEvent = a,
                EventType = a.GetType().FullName,
                Timestamp = DateTime.Now,
            };
            sut.SaveEvent(evta);

            var single = sut.LoadEvents(a.GetType()).Single();
            single.Should().Be.OfType<Dea>();
        }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="evt"></param>
 public void SaveEvent(PersistedDomainEvent evt)
 {
     _collection.Save(evt);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="evt"></param>
 public void SaveEvent(PersistedDomainEvent evt)
 {
     _collection.Save(evt);
 }