Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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