Visual Studio 2015 has added the ability for developers to debug lambda expressions. This is a fantastic addition to the features of our favorite IDE. It allows us to check the results of a lambda expression on the fly and modify the expression to test different scenarios.
We will create a very basic lambda expression and change it in the Watch window to produce a different value.
Add a class called
CSharpSix
. Add a property to this class calledFavoriteFeature
:public class CSharpSix { public string FavoriteFeature { get; set; } }
Next, create a
List<CSharpSix>
object and add a few of your favorite C# 6 features to this list:List<CSharpSix> FavCSharpFeatures = new List<CSharpSix>(); CSharpSix feature1 = new CSharpSix(); feature1.FavoriteFeature = "String Interpolation"; FavCSharpFeatures.Add(feature1); CSharpSix feature2 = new CSharpSix(); feature2.FavoriteFeature = "Exception Filters"; FavCSharpFeatures.Add(feature2...