title: How to use char.TryParse with my menu
body: <p>I created a player class and made a array from that class for my menu driven player system I am trying to use my GetChar method to keep displaying the prompt and reading whatever the user typed on the keyboard until Char.TryParse can convert the input to a char But when I use it just repeats the error message invaild input try again over and over again.</p>
  
  <p>Any help would be appreciated</p>
  
  <pre><code>//Returns either a 'C', 'R', 'U', 'D', 'L', or 'X' to the caller
      static char GetMenuItem()
      {
          char menuItem;
          DisplayMenu();
          menuItem = IOConsole.GetChar((Console.ReadLine()));
  
          while (menuItem != 'C'
              &amp;&amp; menuItem != 'L' &amp;&amp; menuItem != 'X' &amp;&amp; menuItem != 'R' &amp;&amp; menuItem != 'U' &amp;&amp; menuItem != 'D')
          {
              Console.WriteLine("\nError - Invalid menu item");
              DisplayMenu();
              //menuItem = IOConsole.GetChar((Console.ReadLine()));
          }
          return menuItem;
      }
  </code></pre>
  
  <blockquote>
    <p>Here is my GetChar method</p>
  </blockquote>
  
  <pre><code>public static char GetChar(string prompt)
      {
  
  
          char validChar;
  
          var input = Console.ReadKey();
  
          while (!Char.TryParse(input.Key.ToString(), out validChar))
          {
              Console.WriteLine("Invalid entry - try again.");
  
              Console.Write(prompt);
          }
  
          return validChar;
      }
  </code></pre>