title: ConvertAll (UWP C#)
body: <p>I'm writing app for Windows 10 UWP(C#)</p>
  
  <p>I have problem</p>
  
  <p>I have this code </p>
  
  <pre><code>  private string GenerateSignature(Dictionary&lt;string, string&gt; parameters, string method, string endpoint)
      {
          var baserequesturi = Regex.Replace(System.Net.WebUtility.HtmlEncode(this.ApiUrl + endpoint), "(%[0-9a-f][0-9a-f])", c =&gt; c.Value.ToUpper());
          var normalized = NormalizeParameters(parameters);
  
          var signingstring = string.Format("{0}&amp;{1}&amp;{2}", method, baserequesturi,
              string.Join("%26", normalized.OrderBy(x =&gt; x.Key).ToList().ConvertAll(x =&gt; x.Key + "%3D" + x.Value)));
          var signature =
              Convert.ToBase64String(HashHMAC(Encoding.UTF8.GetBytes(this.ConsumerSecret),
                  Encoding.UTF8.GetBytes(signingstring)));
          Debug.WriteLine(signature);
          return signature;
      }
  </code></pre>
  
  <p>But <code>.ConvertAll</code> show this error</p>
  
  <pre><code>  Severity  Code    Description Project File    Line    Suppression State
  Error   CS0029  Cannot implicitly convert type 'System.Threading.Tasks.Task&lt;string&gt;' to 'string'    Milano  C:\Users\nemes\Documents\GitHub\Milano_pizza\Milano\MainPage.xaml.cs    41  Active
  </code></pre>
  
  <p>How I need to rewrite code to solve this problem?</p>
  
  <p>Thank's</p>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>var baserequesturi = Regex.Replace(System.Net.WebUtility.HtmlEncode(this.ApiUrl + endpoint), "(%[0-9a-f][0-9a-f])", c =&gt; c.Value.ToUpper());
          var normalized = NormalizeParameters(parameters);
  </code></pre>
  
  <p>NormalizeParameters</p>
  
  <pre><code> private Dictionary&lt;string, string&gt; NormalizeParameters(Dictionary&lt;string, string&gt; parameters)
      {
          var result = new Dictionary&lt;string, string&gt;();
          foreach (var pair in parameters)
          {
              var key = System.Net.WebUtility.HtmlEncode(System.Net.WebUtility.HtmlDecode(pair.Key));
              key = Regex.Replace(key, "(%[0-9a-f][0-9a-f])", c =&gt; c.Value.ToUpper()).Replace("%", "%25");
              var value = System.Net.WebUtility.HtmlEncode(System.Net.WebUtility.HtmlDecode(pair.Value));
              value = Regex.Replace(value, "(%[0-9a-f][0-9a-f])", c =&gt; c.Value.ToUpper()).Replace("%", "%25");
              result.Add(key, value);
          }
          return result;
      }
  </code></pre>