Exemple #1
0
        private static async Task RunAsync2()
        {
            var client = new HotelsApiClientV2(HttpClient);

            var hotel = await client.GetHotel(27);

            Console.WriteLine(hotel.Name);
        }
Exemple #2
0
        private static async Task RunAsync3()
        {
            var client = new HotelsApiClientV2(HttpClient);

            var cancellationTokenSource = new CancellationTokenSource();

            cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(5));

            await client.LongRunning(cancellationTokenSource.Token);
        }