Skip to content

Instantly share code, notes, and snippets.

@nicolastakashi
Last active December 23, 2019 22:26
Show Gist options
  • Select an option

  • Save nicolastakashi/09f4e80222436640872fe72fefc51003 to your computer and use it in GitHub Desktop.

Select an option

Save nicolastakashi/09f4e80222436640872fe72fefc51003 to your computer and use it in GitHub Desktop.
var calcularSalarioTask = CalcularSalarioAsync();
calcularSalarioTask.ContinueWith(t =>
{
var erros = t.Exception as AggregateException;
if (erros == null)
{
Console.WriteLine(t.Result);
}
else
{
Exception excecaoAtual = errors.InnerExceptions.First();
Console.WriteLine(excecaoAtual.Message);
}
}, TaskScheduler.FromCurrentSynchronizationContext());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment