void Update(ICommand<SecurityId> c, Action<SecurityAggregate> action)
 {
     var eventStream = _eventStore.LoadEventStream(c.Id);
     var state = new SecurityState(eventStream.Events);
     var agg = new SecurityAggregate(state);
     action(agg);
     _eventStore.AppendEventsToStream(c.Id, eventStream.StreamVersion, agg.Changes);
 }
        void Update(ICommand <SecurityId> c, Action <SecurityAggregate> action)
        {
            var eventStream = _eventStore.LoadEventStream(c.Id);
            var state       = new SecurityState(eventStream.Events);
            var agg         = new SecurityAggregate(state);

            action(agg);
            _eventStore.AppendEventsToStream(c.Id, eventStream.StreamVersion, agg.Changes);
        }
Exemplo n.º 3
0
        void Update(ICommand <SecurityId> c, Action <SecurityAggregate> action)
        {
            var eventStream = _eventStore.LoadEventStream(c.Id);
            var state       = new SecurityState(eventStream.Events);
            var agg         = new SecurityAggregate(state);

            using (Context.CaptureForThread())
            {
                action(agg);
                _eventStore.AppendToStream(c.Id, eventStream.Version, agg.Changes);
            }
        }
        void Update(ICommand<SecurityId> c, Action<SecurityAggregate> action)
        {
            var eventStream = _eventStore.LoadEventStream(c.Id);
            var state = new SecurityState(eventStream.Events);
            var agg = new SecurityAggregate(state);

            using (var capture = Context.CaptureForThread())
            {
                action(agg);
                _eventStore.AppendToStream(c.Id, eventStream.Version, agg.Changes, capture.Log);
            }
        }
Exemplo n.º 5
0
 public SecurityAggregate(SecurityState state)
 {
     _state = state;
 }
Exemplo n.º 6
0
 public SecurityAggregate(SecurityState state)
 {
     _state = state;
 }