private ICommandExecutor CreateCommandExecutor(int maxQueryConnectionsLimit) { var commandExecutor = new DefaultCommandExecutor(maxQueryConnectionsLimit); commandExecutor.OnGetConnections += (c, s, i) => { if (_shardingConnection != null) { return(_shardingConnection.GetConnections(c, s, i)); } throw new ShardingException( $"{nameof(ShardingCommand)} {nameof(_shardingConnection)} is null"); }; return(commandExecutor); }