How to read values from the querystring with ASP.NET Core? : <p>I'm building one RESTful API using ASP.NET Core MVC and I want to use querystring parameters to specify filtering and paging on a resource that returns a collection.</p>

<p>In that case, I need to read the values passed in the querystring to filter and select the results to return. </p>

<p>I've already found out that inside the controller <code>Get</code> action accessing <code>HttpContext.Request.Query</code> returns one <code>IQueryCollection</code>.</p>

<p>The problem is that I don't know how it is used to retrieve the values. In truth, I thought the way to do was by using, for example</p>

<pre><code>string page = HttpContext.Request.Query["page"]
</code></pre>

<p>The problem is that <code>HttpContext.Request.Query["page"]</code> doesn't return a string, but a <code>StringValues</code>.</p>

<p>Anyway, how does one use the <code>IQueryCollection</code> to actually read the querystring values?</p>
