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

            var song = songsClient.GetSongsById(id);

            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);
            }
        }
Exemple #2
0
        public static void ShowSongsContentJSON()
        {
            //With Json
            SongsHttpClient songsClient = new SongsHttpClient("http://localhost:20098/", MediaTypeEnum.Json);

            foreach (var song in songsClient.GetAllSongs())
            {
                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 #3
0
        public static void ShowSongsContentJSON()
        {
            //With Json
            SongsHttpClient songsClient = new SongsHttpClient("http://localhost:20098/", MediaTypeEnum.Json);

            foreach (var song in songsClient.GetAllSongs())
            {
                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 #4
0
        public static void ShowSongsContentByIdXML(int id)
        {
            //With Xml
            SongsHttpClient songsClient = new SongsHttpClient("http://localhost:20098/", MediaTypeEnum.Xml);

            var song = songsClient.GetSongsById(id);
            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);
            }
        }