5

Is there any practical benefit of this

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

over this

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

?

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

FrozenHeart
  • 19,844
  • 33
  • 126
  • 242
  • 2
    Have you seen [this thread](http://stackoverflow.com/q/30566848/728795)? It explains a lot – Andrei Oct 13 '16 at 11:15
  • 2
    @Andrei The top answer is quite flawed - see the comments below. Most notably, async is *not* parallel. – Rob Oct 13 '16 at 11:16
  • @Rob ah, the old concurrent vs. async vs. parallel vs. threaded conversation. Can't have that one too many times. – Ant P Oct 13 '16 at 12:13

0 Answers0