Created
October 11, 2021 17:00
-
-
Save mirmostafa/d144a975fb861a5b8332022d4cbbec63 to your computer and use it in GitHub Desktop.
.Net 6.0 Task.WaitAsync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var cts = new CancellationTokenSource(); | |
| var httpClient = new HttpClient(); | |
| var response = await httpClient.GetAsync("https://localhost:5001/downloadfile", cts.Token) | |
| .WaitAsync(TimeSpan.FromMilliseconds(4200), cts.Token); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment