Converting a Controller Method in MVC5 to async

I’m currently working on a Pluralsight course on ASP.NET and I have to admit I’m slow to adopt async methods in my code because it feels a little complex when non-async code is what I’m use to.  I’m feeling like since I’m doing this Pluralsight course I should really show best practices and clearly async controller methods is no doubt a best practice. I’m surprised it was actually so easy.  First, let me show you the code that I had written that is not async that I’m sure you are all familiar with. [crayon-5928fec4ed388245762788/] All I had to change (besides adding the async name space for Task) was to have speakers return a task with the ToListAsync method and change the signature of the method to return a task. Here is the updated … Continue Reading


Get every new post delivered to your Inbox

Join other followers: