This is a good question which nobody asked so far :)
Let's just look at some basics: the value provider used for the queries is a special dictionary containing value-provider objects. It is created when it's accessed, and can be modified as you wish, until you access a query - which then uses the properties contained.
So yes: you can either change existing parameters (like change what QueryString:Id would deliver) or you could also add your own parameter lists, like CodeParams:Size.
To get a good feeling on how to do this, please check https://github.com/2sic/2sxc/blob/master/SexyContent/DataSources/ConfigurationProvider.cs which builds a configuration provider. This is what always runs before your query.
You should be able to access and modify the dictionary by
- Create an own app object
- Create an own configuration object
- InitData of the app using the own configuration object
- Accessing the query
It feels a bit complex, but it's fairly simple. Best check the app-factory to get a feel of the code:
https://github.com/2sic/2sxc/blob/3602461f3c4154857d84c7f6ad1a3d1e96b78ba3/Environment/Dnn7/Factory.cs
Option 2: Note that there is also another way:
You could get the query, and modify it so it doesn't use parameters, but the value you just supplied. This may feel a bit messy, but it's all very clear what happens.
Basically the system is a chaining of data-source items, usually connecting a sources Out["Default"] to the In["Default"]. Each data-source has a different type and different properties.
You can therefor get a query data-source, navigate along the object to the right data-source object, cast it to the right type and then change the filter/parameter property to whatever you need. this will probably take quite some fiddling around though, so I wouldn't recommend it :).