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.

Get .NET Standard 2.0 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.