Ejemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     var client = new ArtistServiceClient();
     client.GetAllArtists().ToList().ForEach(x =>
     {
         cbArtists.Items.Add(x);
     });
 }
Ejemplo n.º 2
0
        private static void DoArtistServicePart()
        {
            var client = new ArtistServiceClient();
            var counter = 1;
            var alternatives = client.GetAllArtists()
                .Select(x => new {MenuNumber = counter++.ToString(), Artist = x})
                .ToList();

            alternatives.ForEach(x => Console.WriteLine(x.MenuNumber + ". " + x.Artist));

            Console.Write("Välj nummer: ");
            var input = Console.ReadLine();

            var result = alternatives.Any(x => x.MenuNumber == input)
                ? client.GetMembers(alternatives.First(x => x.MenuNumber == input).Artist)
                : "Ingen artist på det nummret";

            Console.WriteLine(result);
        }