title: Get Key Name from Model State/ Model State Dictionary?
body: <p>I am wondering how do I get the key name from Model Sate or Model State Dictionary.</p>
  
  <p>When you add a error to the dictionary </p>
  
  <pre><code>  modelStateDictionary.AddModelError("key","errorMessage");
  </code></pre>
  
  <p>you have to specify a key.</p>
  
  <p>I want to get the key name.</p>
  
  <pre><code> foreach (ModelState modelState in modelStateDictionary.Values) 
              {
  
  
  
              }
  </code></pre>
  
  <p>I did the above but that only contains the error message I want to know what the key of that was. I only can find to get all keys that gets stored in a list of strings. I want to get it out each time I go through the foreach loop. So can I not get a key name by index or something? </p>