コード例 #1
0
        static void Main(string[] args)
        {
            var airportDatabase = new AirportDatabase();

            _airportRepository = new AirportRepository(airportDatabase);

            // create interface menu

            var menuOption = MainMenu();

            while (menuOption <= 4)
            {
                switch (menuOption)
                {
                // display all airports
                case 1:
                    GetAllAirports();
                    break;

                // add a new airport to the list
                case 2:
                    AddAirport();
                    break;

                // remove an airport from the list
                case 3:
                    RemoveAirport();
                    break;

                case 4:
                    break;

                default:
                    // validate what the user input
                    Console.WriteLine("That was an invalid option");
                    Clear();
                    break;
                }

                if (menuOption != 4)
                {
                    menuOption = MainMenu();
                }
            }
        }
コード例 #2
0
 public AirportRepository(AirportDatabase airportDatabase)
 {
     _airportDatabase = airportDatabase;
 }