/ 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 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 are pairs leaving our lambda expression as show below.

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

This will help us make our life easier!

Saturnino Pimentel

Saturnino Pimentel

Microsoft MVP, consultor, blogger y conferencista. Saturnino es el cofundador de la comunidad de programadores c# y el meetup de c# de la ciudad de México además de participar con otras comunidades.

Read More

Suscríbete a la lista de correos :)

* indicates required