コード例 #1
0
        void Update(ICommand<RegistrationId> c, Action<RegistrationAggregate> action)
        {
            var stream = _eventStore.LoadEventStream(c.Id);
            var state = new RegistrationState(stream.Events);
            var agg = new RegistrationAggregate(state);

            using (Context.CaptureForThread()) {
                action(agg);
                _eventStore.AppendToStream(c.Id, stream.Version, agg.Changes);
            }
        }
コード例 #2
0
        void Update(ICommand<RegistrationId> c, Action<RegistrationAggregate> action)
        {
            var stream = _eventStore.LoadEventStream(c.Id);
            var state = new RegistrationState(stream.Events);
            var agg = new RegistrationAggregate(state);

            using (Context.CaptureForThread()) {
                action(agg);
                _eventStore.AppendEventsToStream(c.Id, stream.StreamVersion, agg.Changes);
            }
        }
コード例 #3
0
 public RegistrationAggregate(RegistrationState state)
 {
     _state = state;
 }
コード例 #4
0
 public RegistrationAggregate(RegistrationState state)
 {
     _state = state;
 }