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

July 28, 2014

Gets the current Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> object's remaining components.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public TRest Rest { get; }

Property Value

Type: TRest
The value of the current Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> object's remaining components.

The Rest property returns a nested Tuple object that allows access to the eighth though nth components of the tuple. Depending on the total number of components in the tuple, the values of the eighth through fourteenth components can be retrieved from the nested Tuple object's Item1 through Item7 properties. You can then use the Rest property of a nested Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> object to retrieve the Tuple object at the next level of nesting.

You can dynamically determine the number of components in a nested Tuple object that is returned by the Rest property by extracting the digit from its type name. The following example provides an illustration.

The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The seventh component of the 17-tuple is the population in 1900. The example uses the Rest property to retrieve the values of the eighth through fourteenth components, and it uses the Rest property of the nested Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> object to retrieve the values of the remaining components.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2014 Microsoft