public override ICommandResponse Handle(AddNodeToBoutCommand command) { var response = new CommandResponse(); if (!_boutRunnerService.IsRunning(command.BoutId)) { throw new BoutNotFoundException(command.BoutId); } var state = _boutRunnerService.GetBoutState(command.BoutId); var bout = _boutData.Load(command.BoutId); _nodeService.AddToBout(command.NodeId, command.BoutId); response.AddEvent(new InitializeBoutEvent(bout, state), _nodeService.GetConnection(command.NodeId)); response.AddEvent(new NodeJoinedBoutEvent(command.NodeId, command.BoutId), command.Originator); return(response); }