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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 public FactoryAggregate(FactoryState state)
 {
     _state = state;
 }
Ejemplo n.º 4
0
 public FactoryAggregate(FactoryState state)
 {
     _state = state;
 }