예제 #1
0
        public static void getBeers(RootObj rootObj)
        {
            Console.WriteLine(" Give the Brewery name to see the beers ");
            string BreweryName = Console.ReadLine();

            foreach (var a in rootObj.Embedded.BreweriesList)
            {
                if (a.Name == BreweryName)
                {
                    var data  = Connect.Connect1(a.LinksClass.Hrefobj3.href);
                    var items = JsonConvert.DeserializeObject <Beerclass>(data);
                    if (items.TotalResults != 0)
                    {
                        Console.WriteLine("Beers: ");
                        foreach (var beerElement in items.ResourceList)
                        {
                            Console.WriteLine(beerElement.Name);
                        }
                    }
                    else
                    {
                        Console.WriteLine("The breweries has no beers");
                    }
                }
            }
        }
예제 #2
0
 public static void getBreweries(RootObj rootObj)
 {
     foreach (var brewerieElement in rootObj.Embedded.BreweriesList)
     {
         Console.WriteLine(brewerieElement.Name);
     }
 }