Created
June 10, 2018 11:32
-
-
Save NMZivkovic/7b917bc98a1b0ab3772a9f92d2b64312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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