This line looks weird:

```csharp
qsBuilder.Append(BuildCustomQueryString(connection, qsBuilder.ToString());
```

You're doing ToString() on the StringBuilder then appending it to the builder. You can just leave the old clode since it worked just as well.