I feel a bit absurd asking this but I can\'t find a way to get parameters for a get request at
/api/foo?sort=name
for instance.
In the ApiControll
The ApiController is designed to work without the HttpContext object (making it portable, and allowing it to be hosted outside of IIS).
You can still access the query string parameters, but it is done through the following property:
Request.GetQueryNameValuePairs()
Here's an example loop through all the values:
foreach (var parameter in Request.GetQueryNameValuePairs())
{
var key = parameter.Key;
var value = parameter.Value;
}
You're trying to build an OData webservice? If so, just return an IQueryable, and the Web API will do the rest.