How to do it...

  1. Open Visual Studio 2017.
  2. Click File | New | Project to create a project. 
  3. In the New Project dialog box, expand the Other Project Types node in the left-hand pane and select Visual Studio Solutions. In the right-hand pane, select Blank Solution.
  4. In the Name: textbox, type Chapter4.Functions and, in the Location: textbox, select a path from the drop-down box or click on the Browse... button to locate a path:
  1. Click OK.
  2. Now, your Solution Explorer (Ctrl + Alt + L) should look like this:
  1. Now, right-click on the Chapter4.Functions label in the Solution Explorer and select Add  | New Project.
  2. In the New Project dialog box, expand the Visual C# node.
  1. Select .NET Standard in the left-hand pane and Class Library (.NET Standard) in the right-hand pane:
  1. Now, in the Name: textbox, type Chapter4.Functions.FuncLib. Leave the other defaults as they are and click OK:
  1. Now, the Solution Explorer (Ctrl + Alt + L) should look like this:
  1. Now, select Class1.cs in the Solution Explorer and press F2 to rename the file Helper.cs.
  2. Answer Yes in the confirmation dialog box that asks to rename the class name as well.
  3. Now, double-click on the Helper.cs label in the Solution Explorer.
  4. In the code window for Helper.cs, type the following code in between the curly brackets of the class:
      public Func<int, int> AddOne = n => n + 1;

public Func<int, bool> IsZero = n => n == 0;
  1. Let's press Ctrl + Shift + B for a quick build to check that all the syntax is correct.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.142.115