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); }
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); }
public EventDescriptor(Guid id, Event eventData, int version) { EventData = eventData; Version = version; Id = id; }
private void ApplyChange(Event @event, bool isNew) { this.AsDynamic().Apply(@event); if(isNew) _changes.Add(@event); }
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); }