How to do it...

  1. Create a console application and add a class called LambdaExample to the console application. Add a property to this class called FavThings:
        public class LambdaExample        {          public string FavThings { get; set; }        }
  1. In the console application, create a List<LambdaExample> object and add a few of your favorite things to this list:
        List<LambdaExample> MyFavoriteThings = new List<LambdaExample>();        LambdaExample thing1 = new LambdaExample();        thing1.FavThings = "Ice-cream";        MyFavoriteThings.Add(thing1);        LambdaExample thing2 = new LambdaExample();        thing2.FavThings = "Summer Rain";        MyFavoriteThings.Add(thing2);        LambdaExample thing3 = new LambdaExample();        thing3.FavThings = "Sunday morning snooze"; MyFavoriteThings.Add(thing3);  ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.