I need to implement an asynch Action in my Controller for a long running external API call.
Looking at some tutorials, I have implemented my method like this:
<
As the other person wrote you need an asynchronous action to await it, to make View()
async wrap it in a Task.Run
[AsyncTimeout(200)]
public async Task DoAsync()
{
// Execute long running call.
return await Task.Run(() => View());
}
Afterwards this method is mainly useful for calling from other async functions or callbacks.