Created
June 10, 2018 11:39
-
-
Save NMZivkovic/2e36b4b6b1c01f555bae9ff8c6ab1c73 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 = MultiplyAsync(0, 0).Result; | |
Console.WriteLine(res); | |
} | |
private async ValueTask<int> MultiplyAsync(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