asp.net-mvc-5

Asynchronous Controller in MVC 5

Defination

Using an Asynchronous Controller in ASP.NET MVC. The AsyncController class enables you to write asynchronous action methods. You can use asynchronous action methods for long-running, non-CPU bound requests. This avoids blocking the Web server from performing work while the request is being processed.

Asynchronous Controller

public async Task<actionresult> Index()
{
     return  View("View", await db.UserMasers.ToListAsync());
}

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow