Skip to content

Instantly share code, notes, and snippets.

@BojanKomazec
Created December 12, 2015 15:26
Show Gist options
  • Save BojanKomazec/0496845e6bcf9a1461cb to your computer and use it in GitHub Desktop.
Save BojanKomazec/0496845e6bcf9a1461cb to your computer and use it in GitHub Desktop.
using System.Threading.Tasks;
public class Program
{
public static void Main()
{
MainAsync().Wait();
}
private static async Task MainAsync()
{
var c = new C();
var intValue1 = await c.Foo1Async();
var intValue2 = await c.Foo2Async();
}
}
public class C
{
public Task<int> Foo1Async()
{
return Task.FromResult(0);
}
public async Task<int> Foo2Async()
{
return await Task.FromResult(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment