Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created August 12, 2017 15:34
Show Gist options
  • Save jskeet/b5f0acad8557416990942fa8f0bc7e5d to your computer and use it in GitHub Desktop.
Save jskeet/b5f0acad8557416990942fa8f0bc7e5d to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
class Test
{
static void Main()
{
Foo().GetAwaiter().GetResult();
}
static async Task Foo()
{
var task = Task.FromResult((x: 10, y: 20));
var tuple = await task;
Console.WriteLine(tuple.x);
Console.WriteLine(tuple.y);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment