How to call an async method from a console app main method

added by DotNetKicks
3/8/2017 7:19:16 AM

1 Kicks, 469 Views

I find myself needing to look this code snippet up time to time so I thought I'd write it up. I needed to call an ASP.NET Core Web API which I discussed here, from a .NET Core Console Application, created similar to that shown in Figure 1.