private static async void getCommand(string command, VelibIntermediaryClient client) { switch (command) { case nameof(client.GetStations): Console.Write("City name: "); var city = Console.ReadLine(); var stations = await client.GetStationsAsync(city); foreach (var station in stations) { Console.WriteLine($"{station.Name} available bikes: {station.available_bikes}"); } break; case nameof(client.GetContracts): var contracts = await client.GetContractsAsync(); foreach (var contract in contracts) { Console.WriteLine(contract.name); } Console.WriteLine(contracts); break; case "exit": System.Environment.Exit(0); break; default: { Console.WriteLine("The commands are"); Console.WriteLine(nameof(client.GetContracts)); Console.WriteLine(nameof(client.GetStations)); Console.WriteLine("exit"); Console.WriteLine("help"); break; } } }
private async void GetSations(object sender, RoutedEventArgs routedEventArgs) { stations = new List <Station>(await velibClient.GetStationsAsync(((Contract)CityName.SelectedValue).name)); stations.Sort((station, station1) => station.available_bikes - station1.available_bikes); StationView.ItemsSource = stations; }