Exemple #1
0
        public static void ShowAlbumsContentByIdXML(int id)
        {
            //With Xml
            AlbumsHttpClient albumsClient = new AlbumsHttpClient("http://localhost:20098/", MediaTypeEnum.Xml);

            var album = albumsClient.GetAlbumById(id);
            Console.WriteLine("Album Producer - {0}; Title - {1}; Year - {2}", album.Producer, album.Title, album.Year);
            Console.WriteLine("Album Songs: ");

            foreach (var song in album.Songs)
            {
                Console.WriteLine("    Song Title - {0}; Year - {1}; Genre - {2}", song.Title, song.Year, song.Genre);

                foreach (var artist in song.Artists)
                {
                    Console.WriteLine("    - Artist Name - {0}; Country - {1}; Date of birth - {2}", artist.Name, artist.Country, artist.DateOfBirth);
                }
                Console.WriteLine(new string('*', Console.BufferWidth));
            }
        }
Exemple #2
0
        public static void ShowAlbumsContentByIdXML(int id)
        {
            //With Xml
            AlbumsHttpClient albumsClient = new AlbumsHttpClient("http://localhost:20098/", MediaTypeEnum.Xml);

            var album = albumsClient.GetAlbumById(id);

            Console.WriteLine("Album Producer - {0}; Title - {1}; Year - {2}", album.Producer, album.Title, album.Year);
            Console.WriteLine("Album Songs: ");

            foreach (var song in album.Songs)
            {
                Console.WriteLine("    Song Title - {0}; Year - {1}; Genre - {2}", song.Title, song.Year, song.Genre);

                foreach (var artist in song.Artists)
                {
                    Console.WriteLine("    - Artist Name - {0}; Country - {1}; Date of birth - {2}", artist.Name, artist.Country, artist.DateOfBirth);
                }
                Console.WriteLine(new string('*', Console.BufferWidth));
            }
        }