Under what scenarios would one want to use
public async Task AsyncMethod(int num)
instead of
public async void AsyncMetho
According to Microsoft documentation, should NEVER use async void
Do not do this: The following example uses
async void
which makes the HTTP request complete when the first await is reached:
Which is ALWAYS a bad practice in ASP.NET Core apps.
Accesses the HttpResponse after the HTTP request is complete.
Crashes the process.