Пример #1
0
        public EventId Handle(CreateToDo cmd)
        {
            var e = new ToDoCreated {
                Subject = cmd.Subject
            };

            _es.Record(null, e); //expectedLastEventId can be null because this is a single user and single thread app
            return(e.Id);
        }
Пример #2
0
        public string Handle(CreateToDo cmd)
        {
            var e = new ToDoCreated {
                Subject = cmd.Subject
            };

            _es.Record(e);
            return(e.Id);
        }
Пример #3
0
 public (Response Msg, Notification[] Notifications) Handle(IMessage msg)
 {
     var(ctx, loadedVersion) = _load(msg);
     var(status, events, expectedVersion, notifications) = _process(msg, ctx, loadedVersion);
     var(version, finalEventNumber) = _es.Record(events, expectedVersion); //TODO: handle ES version conflict
     _update(events, version, finalEventNumber);
     return(status, notifications);
 }