Skip to content

Instantly share code, notes, and snippets.

@jesuscampos
Last active October 14, 2018 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesuscampos/966d8c4d8dfa95f4c90e0bfbd89955ea to your computer and use it in GitHub Desktop.
Save jesuscampos/966d8c4d8dfa95f4c90e0bfbd89955ea to your computer and use it in GitHub Desktop.
private async Task DoWorkAsync()
{
// Comienza a ejecutarse como un método síncrono
HttpClient client = new HttpClient();
// await [Task]: se inicia la operación asíncrona y se suspende
// la ejecución del resto del código
await client.GetStringAsync(url);
// resto del código
// ... se ejecutará cuando la tarea asíncrona se complete
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment