Do not await an async method
From this answer on StackOverflow – to avoid the compiler warning you about not awaiting an async method. Not sure if this is the best answer, but it works for me:
From this answer on StackOverflow – to avoid the compiler warning you about not awaiting an async method. Not sure if this is the best answer, but it works for me:
// PM> Install-Package Nito.AsyncEx using Nito.AsyncEx; class Program { static void Main(string[] args) { AsyncContext.Run(() => MainAsync(args)); } static async void MainAsync(string[] args) { // await Something… }} This was an answer on StackOverflow by async/await superstar and blogger Stephen Cleary, who wrote the referenced NuGet package.
JavaScript gives you lots of different ways to run code asynchronously. Originally callbacks were the only way to go. Now you’ve got RxJS Observables, Promises, and the newest “async” and “await” keywords, which actually are just syntactic sugar for Promises. Learn more here View code on GitHub