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

            var artist = artistsClient.GetArtistById(id);
            Console.WriteLine("    - Artist Name - {0}; Country - {1}; Date of birth - {2}", artist.Name, artist.Country, artist.DateOfBirth);

            foreach (var song in artist.Songs)
            {
                Console.WriteLine("    Song Title - {0}; Year - {1}; Genre - {2}", song.Title, song.Year, song.Genre);
            }
        }
Exemple #2
0
        public static void ShowArtistsContentByIdXML(int id)
        {
            //With Xml
            ArtistsHttpClient artistsClient = new ArtistsHttpClient("http://localhost:20098/", MediaTypeEnum.Xml);

            var artist = artistsClient.GetArtistById(id);

            Console.WriteLine("    - Artist Name - {0}; Country - {1}; Date of birth - {2}", artist.Name, artist.Country, artist.DateOfBirth);

            foreach (var song in artist.Songs)
            {
                Console.WriteLine("    Song Title - {0}; Year - {1}; Genre - {2}", song.Title, song.Year, song.Genre);
            }
        }
Exemple #3
0
        public static void ShowArtistsContentJSON()
        {
            //With Json
            ArtistsHttpClient artistsClient = new ArtistsHttpClient("http://localhost:20098/", MediaTypeEnum.Json);

            foreach (var artist in artistsClient.GetAllArtists())
            {
                Console.WriteLine("    - Artist Name - {0}; Country - {1}; Date of birth - {2}", artist.Name, artist.Country, artist.DateOfBirth);

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

                Console.WriteLine(new string('*', Console.BufferWidth));
            }
        }
Exemple #4
0
        public static void ShowArtistsContentJSON()
        {
            //With Json
            ArtistsHttpClient artistsClient = new ArtistsHttpClient("http://localhost:20098/", MediaTypeEnum.Json);

            foreach (var artist in artistsClient.GetAllArtists())
            {
                Console.WriteLine("    - Artist Name - {0}; Country - {1}; Date of birth - {2}", artist.Name, artist.Country, artist.DateOfBirth);

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

                Console.WriteLine(new string('*', Console.BufferWidth));
            }
        }