コード例 #1
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 (var capture = Context.CaptureForThread())
            {
                action(agg);
                _eventStore.AppendToStream(c.Id, eventStream.Version, agg.Changes, capture.Log);
            }
        }
コード例 #2
0
 public SecurityAggregate(SecurityState state)
 {
     _state = state;
 }