Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Convert Synchronous Method to Async | Async/Await Fundamentals and Converting Sync to Async
C# Async and Await Practice

bookChallenge: Convert Synchronous Method to Async

Taak

Swipe to start coding

Refactor the provided synchronous DownloadFile method so that it becomes asynchronous using async and await. The current version blocks the thread for 3 seconds to simulate a file download.

  • Modify the method so that it does not block the calling thread.
  • Replace the blocking call with an asynchronous alternative that simulates a 3-second delay.
  • Ensure the method uses the correct async method signature and is called appropriately from Main.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 2
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

bookChallenge: Convert Synchronous Method to Async

Veeg om het menu te tonen

Taak

Swipe to start coding

Refactor the provided synchronous DownloadFile method so that it becomes asynchronous using async and await. The current version blocks the thread for 3 seconds to simulate a file download.

  • Modify the method so that it does not block the calling thread.
  • Replace the blocking call with an asynchronous alternative that simulates a 3-second delay.
  • Ensure the method uses the correct async method signature and is called appropriately from Main.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 2
single

single

some-alt