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-59c119d971991248258365/] 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

LINQ Support in Visual Studio 2015 Debugger Awesome

I’ve been wanting to do this for a very long time.  I’m in the debugger of Visual Studio 2015 and I have some data structure that is a collection of objects.  To find what I want, I’ve had to either write ugly conditional debugging statements or put in some temporary c# if statements to stop on what I wanted and examine it. Now, I can just write the LINQ code in the watch window of Visual Studio and see exactly what I want.  Check out the screen shot below and notice that I just typed in: meetupResults.results.Select(a=>a.urlname).ToList() and I got exactly what I wanted. Very nice! … Continue Reading

Visual Studio 2015, First and Second Impressions

The new Microsoft Visual Studio 2015 is out and I have to say I’m hooked. I was previously hooked on Visual Studio 2012 even though I had a license for VS 2013. The reason was that on bigger projects I’d find that editing source files (C#) was just slow. The VS editor would be slow to keep up with my typing and I’d constantly be getting unexplained pauses while VS did some sort of internal management (who knows what and who cares). I’ve been using VS2015 now for a few weeks and I can 100% say that it is always faster than VS2012 (and of course VS2013).  I also like a lot of the features, one in particular which spurred me to make this post is it shows me (on the method name as shown below) when the file was last updated. It knows that … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: