/ c#

Debugging lambda expressions in Visual Studio 2015

One of the feature that we needed in Visual Studio and that I personally expected for some time is the ability to debug lambda expressions, well with the release of Visual Studio 2015 we have the pleasant surprise that this feature has been aggregate and make use of it is easy.

Consider the following example in which we will create a collection of integers ranging from 1 - 100.

 var numeros= Enumerable.Range(1, 100);

Then we'll add the field to Watch panel with a right click and selecting Add Watch option (probably you already know this).

With this, we will have our field and know what it contains, then edit the content and the intellisense help us to select any of our extension methods.


For this example, we'll show all the numbers that pair leaving our lambda expression as I show below.

And ready we can see the result of our lambda expression.

This will help us make our life easier!
goodbye!

Saturnino Pimentel

Saturnino Pimentel

Microsoft MVP, consultant, blogger, and speaker. Saturnino is a co-founder of the community programadores c# and the c# meetup of the Mexico city also he enjoys working with other communities.

Read More

Suscríbete a la lista de correos :)

* indicates required