title: Modify GetQueryNameValuePairs() for UrlHelper.Link in ASP.NET WebApi
body: <p>With ASP.NET WebApi, when I send GET <code>api/question?page=0&amp;name=qwerty&amp;other=params</code> and API should give result within pagination envelop.</p>
  
  <p>For that, I'd like to put result and change given <code>page</code> querystring to other values.</p>
  
  <p>I tried as below code but I got a bad feeling about this.</p>
  
  <pre><code>protected HttpResponseMessage CreateResponse(HttpStatusCode httpStatusCode, IEnumerable&lt;Question&gt; entityToEmbed)
  
      // get QueryString and modify page property
      var dic = new HttpRouteValueDictionary(Request.GetQueryNameValuePairs());
      if (dic.ContainsKey("page"))
          dic["page"] = (page + 1).ToString();
      else
          dic.Add("page", (page + 1).ToString());
  
      var urlHelper = new UrlHelper(Request);
      var nextLink= page &gt; 0 ? urlHelper.Link("DefaultApi", dic) : null;
  
      // put it in the envelope
      var pageEnvelope = new PageEnvelope&lt;Question&gt;
          {
              NextPageLink = nextLink,
              Results = entityToEmbed
          };
  
          HttpResponseMessage response = Request.CreateResponse&lt;PageEnvelope&lt;Question&gt;&gt;(httpStatusCode, pageEnvelope, this.Configuration.Formatters.JsonFormatter);
          return response;
      }
  </code></pre>
  
  <p>The NextPageLink gives a lot complex result.:<br>
       <code>http://localhost/api/Question?Length=1&amp;LongLength=1&amp;Rank=1&amp;SyncRoot=System.Collections.Generic.KeyValuePair%602%5BSystem.String%2CSystem.String%5D%5B%5D&amp;IsReadOnly=False&amp;IsFixedSize=True&amp;IsSynchronized=False&amp;page=1</code></p>
  
  <p>My question is,  </p>
  
  <ol>
  <li>My page handling with <code>Dictionary</code> approach seems dirty and wrong. Is there better way to address my problem?</li>
  <li>I don't know why <code>urlHelper.Link(routeName, dic)</code> gives such a verbose ToString result. How to get rid of unusable Dictionary-related properties?</li>
  </ol>