I asked a question today How can I run a method without waiting for long running process and I got a good answer and ajax solved my problem. But now my question is why should I still use async await keywords?
public async Task<ActionResult> DoSomeAsyncStuff()
{
var model = new MyModel();
await Task.Delay(20000);//My long-running process is getting data from an API with "HttpWebRequest".
model.Name = "Something";
//Assigning other model properties
return PartialView("_InnerView", model);
}
Isn't the async await keywords to avoid blocking UI? But in the web I can't see any blocking UI in my case in the web unlike WinForms. The above code and ajax works great even without async await keywords. So someone please can explain why should I use them and what is their usages?