Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created June 10, 2018 11:32
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 NMZivkovic/7b917bc98a1b0ab3772a9f92d2b64312 to your computer and use it in GitHub Desktop.
Save NMZivkovic/7b917bc98a1b0ab3772a9f92d2b64312 to your computer and use it in GitHub Desktop.
public void Example()
{
int res = MultipyAsync(0, 0).Result;
Console.WriteLine(res);
}
private async Task<int> MultipyAsync(int x, int y)
{
if (x == 0 || y == 0)
{
return 0;
}
return await Task.Run(() => x * y);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment