title: HttpContext.Current.Request.Form.AllKeys in ASP.NET CORE version
body: <pre><code>foreach (string key in HttpContext.Current.Request.Form.AllKeys)
  {
     string value = HttpContext.Current.Request.Form[key];
  }
  </code></pre>
  
  <p>What is the .net core version of the above code? Seems like .net core took out <strong>AllKeys</strong> and replaced it with <strong>Keys</strong> instead. I tried to convert the above code to the .net core way, but it throws an invalid operation exception.</p>
  
  <blockquote>
    <p>HttpContext.Request.Form = 'HttpContext.Request.Form' threw an exception of type 'System.InvalidOperationException'</p>
  </blockquote>
  
  <p>Converted code:</p>
  
  <pre><code>foreach (string key in HttpContext.Request.Form.Keys)
  {      
  }
  </code></pre>