At my new employer we access all our database objects via NHibernate, which is an ORM product I am starting to fall in love with, this encourages the pervasive use of LINQ. This is a very good thing, but it can also lead to a bit of debugging frustration because it can be very difficult to get to the details of a LINQ query without actually performing an inline select into some temporary object. You may have even tried to push a few queries into the immediate window, which mostly results in “feature not supported” errors.

Immediate Window

With Visual Studio 2015 I can now run any adhoc, real time LINQ queries in the Immediate Window! I get full access to Intellisense and get immediate feedback on things like Count(), Max(), Min(), etc.

Visual Studio Immediate Window

This is just LINQ so of course you can use lambda expressions to your hearts content. This allows me to look at objects using LINQ while debugging, without having to put unnecessary code in place to capture subsets of data.

Watch Window

What is more impressive is that you can then put queries directly into your Watch Window! This is the feature I have been waiting for, debugging with LINQ is finally a first class concept along with regular objects and value types.

Visual Studio Watch Window

This may be the most useful feature that I did not realize I absolutely need. Debugging LINQ has never been easier.

Related Posts