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); }
public string Handle(CreateToDo cmd) { var e = new ToDoCreated { Subject = cmd.Subject }; _es.Record(e); return(e.Id); }
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); }