Tuples and deconstruction
Tuples have not been newly introduced in the current version but were introduced with the .NET 4.0 release. In the present release, they have been improved.
Tuples
Tuples are there at whatever point a particular case needs to return multiple values from a method. For instance, let's say we have to find odd and even numbers from a given number series.
Note
Tuples are an unchanging information esteem that hold related data. Tuples used to aggregate together related data, for example, such that a person's name, age, gender and whatever you want data as an information.
To complete this, our method should return or provide us the result with a number and saying whether this is an odd number or even number. For a method that will return these multiple values, we could use custom datatypes, dynamic return types, or out parameters, which sometimes will create confusion for a developer.
Note
To use tuples, you need to add the NuGet package:https://www.nuget.org/packages/System...