title: Get value from ModelState with key name
body: <p>I am adding some error messages to my <code>ModelState</code> from controller so that I can display it in my view. My Code is like this</p>
  
  <pre><code>ModelState.AddModelError(key: "MyError", errorMessage: "This phone number is already in use. Please register with a different phone number.");
  </code></pre>
  
  <p>And in my view I am displaying it like this</p>
  
  <pre><code>foreach (ModelState modelState in ViewData.ModelState.Values)
  {     
      var errors = modelState.Errors;
      if (errors.Any())
      {
          foreach (ModelError error in errors)
          {
              &lt;p class="common-error"&gt;@error.ErrorMessage&lt;/p&gt;
          }
      }
  }
  </code></pre>
  
  <p>One issue with this approach is that, It is displaying all kind of <code>ModelState</code> errors where I want only to show error messages with a key <code>MyError</code>. how can I make this?</p>