title: Whenever user chooses option 3 "Quit" wont quit all the way out of Master loop. Any help would be appreciated. thanks
body: <p>In the Showmenu, option 3 is to Quit, but app will not quit all the way out.It looks like it is returning the else statement from get menu option. Not sure why. If you run the application you will see.</p>
  <pre><code>using System;
      using System.Collections.Generic;
      using System.IO;
      using System.Linq;
      using System.Net.Http;
      using System.Text.Json;
      
      namespace NFLReportsApp
      {
          class Program
          {
              
      
              static void Main(string[] args)
              {
                  var searchFile = new ReadFromFile();
                  var searchEngine = new PlayerSearchEngine();
                  // searchEngine.Initialize();
      
                  var keepSearching = true;
                  while (keepSearching)
                  {
                      ShowMenu();
                      var option = GetMenuOption();
                      switch (option)
                      {
                          case 1:
                              var allPlayers = searchEngine.GetAllPlayers();
                              DisplayPlayers(allPlayers);
                              break;
                          case 2:
                              var searchName = GetPlayerSearchName();
                              var matchingPlayer = searchEngine.SearchPlayers(searchName);
                              DisplayPlayers(matchingPlayer);
                              break;
                          case 3:
                              var searchText = GetTextSearch();
                              var matchingFile = searchFile.SearchFiles(searchText);
                              break;
      
                          case 4:
                              keepSearching = false;
                              return;
      
                      }
      
                  }
      
              }
      
              private static object GetTextSearch()
              {
                  throw new NotImplementedException();
              }
      
              public static void DisplayPlayers(List&lt;DisplayPlayers&gt; allPlayers)
              {
                  if (allPlayers.Count == 0)
                  {
                      Console.WriteLine(&quot;No players found.&quot;);
                  }
                  var i = 0;
                  foreach (var player in allPlayers)
                  {
                      Console.WriteLine($&quot;{++i}) {player.strPlayer}&quot;);
                  }
              }
      
              public static string GetPlayerSearchName()
      
              {
      
                  while (true)
                  {
                      Console.WriteLine(&quot;Enter a players name:&quot;);
                      var searchName = Console.ReadLine();
                      if (!string.IsNullOrWhiteSpace(searchName))
                      {
                          return searchName;
                      }
                      else
                      {
                          Console.WriteLine($&quot;Invalid player name {searchName}&quot;);
                      }
                  }
      
      
              }
      
              public static object GetMenuOption()
              {
                  while (true)
                  {
                      var input = Console.ReadLine();
                      if (Int32.TryParse(input, out var option))
                      {
                          return option;
                      }
                      else
                      {
                          Console.WriteLine($&quot;Invalid solution {option}&quot;);
                          
                      }
      
                  }
              }
      
      
      
              public static void ShowMenu()
              {
                  var reader = new ReadFromFile();
                  var engine = new PlayerSearchEngine();
                  var keepSearching = true;
                  while (keepSearching)
                  {
                      Console.WriteLine(&quot;Type: Search NFL Player, Cleveland Browns or Quit?&quot;);
      
                      var action = Console.ReadLine();
                      if (action == &quot;Search NFL Player&quot;)
                      {
                          Console.WriteLine(&quot;Which player would you like to search for?&quot;);
                          var Name = Console.ReadLine();
                          engine.SearchPlayers(Name);
                          engine.GetAllPlayers();
                      }
                      else if (action == &quot;Cleveland Browns&quot;)
                      {
                          reader.ReadFromText();
                      }
                      else if (action == &quot;Quit&quot;)
                      {
                          keepSearching = false;
                      }
                      else
                      {
                          //IS THERE A WAY TO ADD PLAYERS NAME TO CODE BELOW SO IT RETURNS INVALID
                          Console.WriteLine(action + &quot; is not a valid command&quot;);
                      }
                  }
            
      
              }
      
      
          }
      }
  </code></pre>