void Update(ICommand<FactoryId> c, Action<FactoryAggregate> action)
 {
     var eventStream = _eventStore.LoadEventStream(c.Id);
     var state = new FactoryState(eventStream.Events);
     var agg = new FactoryAggregate(state);
     action(agg);
     _eventStore.AppendEventsToStream(c.Id, eventStream.StreamVersion, agg.Changes);
 }
Пример #2
0
        void Update(ICommand <FactoryId> c, Action <FactoryAggregate> action)
        {
            var eventStream = _eventStore.LoadEventStream(c.Id);
            var state       = new FactoryState(eventStream.Events);
            var agg         = new FactoryAggregate(state);

            action(agg);
            _eventStore.AppendEventsToStream(c.Id, eventStream.StreamVersion, agg.Changes);
        }