Exemple #1
0
        static void Main(string[] args)
        {
            string name;
            int    id = 0;


            do
            {
                Console.WriteLine("   Menu:\n");
                Console.WriteLine("1. View beers and breweries. \n");
                Console.WriteLine("2. Add a new beer. \n");
                Console.WriteLine("3. Exit. \n\n");
                Console.WriteLine("Please, enter your option: ");
                option = Int32.Parse(Console.ReadLine());

                switch (option)
                {
                case 1:
                    Console.Clear();
                    Console.WriteLine("Please, write the ID of which breweries you want to view: ");
                    id = Int32.Parse(Console.ReadLine());
                    Api_GetBreweries(id);
                    Api_GetBeers(id);
                    break;

                case 2:
                    break;

                case 3:
                    Console.WriteLine("What type of beer do you want to add? \n");
                    Console.WriteLine("Please, write the name of beer: ");
                    name = Console.ReadLine();
                    Beers beer = new Beers(name);
                    Api_Post(name);
                    break;

                case 4:
                    break;

                default:
                    Console.WriteLine("Invalid option! Please choose another. \n");
                    Console.ReadKey();
                    break;
                }
            }while (option != 4);
        }
 public Links2(Self2 self, Beers beers)
 {
     this.self  = self;
     this.beers = beers;
 }