Is there any practical benefit to using await-async in action methods

Is there a practical advantage to this

public async Task<IActionResult> Index()
{
    return View(await _context.Movie.ToListAsync());
}

above this

public IActionResult Index()
{
    return View(_context.Movie.ToList());
}

?

Will the server waste its time if we use the latest code?

+4
source share

Source: https://habr.com/ru/post/1657603/


All Articles