Asynchronous controller action methods
ASP.NET supports asynchronous actions using TAP (Task-based Asynchronous Pattern), this was first released in the .NET 4.0 framework and was greatly improved in .NET 4.5 and above using the async
and await
keywords.
In general, asynchronous programming in .NET helps to achieve a responsive application, improve scalability, and handles high number of requests in case of web applications.
.NET Core also supports asynchronous programming in the form of the async
and await
pattern. This pattern should be used when working with I/O or CPU bound or for database access.
As asynchronous means not occurring at the same time, any method called in an asynchronous way will return results later. To co-ordinate with a returned result, we use Task
(no return value, that is, Void
) or Task<T>
(returns a value). The await
keyword allows us to perform other useful work until Task
returns results.
To understand more about the async await
pattern, read through this link...