Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Convert Synchronous Method to Async | Async/Await Fundamentals and Converting Sync to Async
Practice
Projects
Quizzes & Challenges
Questionários
Challenges
/
C# Async and Await Practice
close
Seção 1. Capítulo 2
single

single

bookChallenge: Convert Synchronous Method to Async

Deslize para mostrar o menu

Tarefa

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 2
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

some-alt