C# Tuple

C# has included tuple support through the .Net Framework 4.0. Tuples enables us to store or pass two or more values without declaring a structure or class. It can be used where you want to have a data structure to hold an object with properties, but you don’t want to create a separate type for it. A tuple is useful when you need to pass a data set as a single parameter of a method without using ref and out parameter.

Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>

For Example :

In the following way values present in a tuple can be extracted :

To return a tuple from a method: