Creating a .NET Standard 2.0 library that uses tuples
In this recipe, we will be using C# tuples with our library. Tuples allow you to combine the assignment of multiple variables of varying types in a single statement. For example, you can do this in a single line of code:
(string firstName, string lastName, int yearsOfExperience) = ("Fiqri", "Ismail", 15);Let's have a look at using tuples in a .NET Standard 2.0 library.
Getting ready
Let's launch Visual Studio 2017 and make sure it's updated to the latest version. We will require C# 7.0 to complete this recipe.
How to do it...
- Open Visual Studio 2017.
- Click
File|New|Projectto create a project.
- In the
New Projectdialog box, expand theOther Project Typesnode in the left-hand pane and selectVisual Studio Solutions. In the right-hand pane, selectBlank Solution.
- In the
Name:textbox, typeChapter4.Tuplesand, in theLocation:textbox, select a path from the drop-down box or click on theBrowse...button to locate a path:

- Click
OK. - Now, your...