Esempio n. 1
0
 public void Save(Guid aggregateId, Event @event)
 {
     List<Event> list;
     db.TryGetValue(aggregateId, out list);
     if(list == null)
     {
         list = new List<Event>();
         db.Add(aggregateId, list);
     }
     list.Add(@event);
 }
Esempio n. 2
0
 public void Save(Guid aggregateId, Event @event)
 {
     List<EventDescriptor> list;
     db.TryGetValue(aggregateId, out list);
     if(list == null)
     {
         list = new List<EventDescriptor>();
         db.Add(aggregateId, list);
     }
     var eventDescriptor = new EventDescriptor(@event.Id, @event, @event.Version);
     list.Add(eventDescriptor);
 }
Esempio n. 3
0
 public EventDescriptor(Guid id, Event eventData, int version)
 {
     EventData = eventData;
     Version = version;
     Id = id;
 }
Esempio n. 4
0
 private void ApplyChange(Event @event, bool isNew)
 {
     this.AsDynamic().Apply(@event);
     if(isNew) _changes.Add(@event);
 }
Esempio n. 5
0
 protected void ApplyChange(Event @event)
 {
     ApplyChange(@event, true);
 }
 public void Save(Guid aggregateId, Event eventDescriptor)
 {
     _list.Add(eventDescriptor);
 }
 public void Save(Guid aggregateId, Event eventDescriptor)
 {
     SavedEvents.Add(eventDescriptor);
 }