title: How Can I Convert Request.Form.AllKeys to MVC Core
body: <p>I have this code on a sample written on MVC and I want to change it to MVC Core.</p>
  
  <pre><code>        foreach (string key in Request.Form.AllKeys)
          {
              String value = Request.Form[key];
              requestForm.Add(key, value);
          }
  </code></pre>
  
  <p>Actually I changed it to </p>
  
  <pre><code>        foreach (string key in Request.Form.Keys)
          {
              String value = Request.Form[key];
              requestForm.Add(key, value);
          }
  </code></pre>
  
  <p>but I'm not sure it works correctly. So what should I do?</p>