ValueTuple.Create Method

Definition

Creates a new value tuple instance.

Overloads

Create()

Creates a new value tuple with zero components.

Create<T1,T2,T3,T4,T5,T6,T7,T8>(T1, T2, T3, T4, T5, T6, T7, T8)

Creates a new value tuple with 8 components (an octuple).

Create<T1,T2,T3,T4,T5,T6,T7>(T1, T2, T3, T4, T5, T6, T7)

Creates a new value tuple with 7 components (a septuple).

Create<T1,T2,T3,T4,T5,T6>(T1, T2, T3, T4, T5, T6)

Creates a new value tuple with 6 components (a sexuple).

Create<T1,T2,T3,T4,T5>(T1, T2, T3, T4, T5)

Creates a new value tuple with 5 components (a quintuple).

Create<T1,T2,T3,T4>(T1, T2, T3, T4)

Creates a new value tuple with 4 components (a quadruple).

Create<T1,T2,T3>(T1, T2, T3)

Creates a new value tuple with 3 components (a triple).

Create<T1,T2>(T1, T2)

Creates a new value tuple with 2 components (a pair).

Create<T1>(T1)

Creates a new value tuple with 1 component (a singleton).

Create()

Source:
ValueTuple.cs
Source:
ValueTuple.cs
Source:
ValueTuple.cs

Creates a new value tuple with zero components.

C#
public static ValueTuple Create();

Returns

A new value tuple with no components.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Create<T1,T2,T3,T4,T5,T6,T7,T8>(T1, T2, T3, T4, T5, T6, T7, T8)

Source:
ValueTuple.cs
Source:
ValueTuple.cs
Source:
ValueTuple.cs

Creates a new value tuple with 8 components (an octuple).

C#
public static(T1, T2, T3, T4, T5, T6, T7,(T8)) Create<T1,T2,T3,T4,T5,T6,T7,T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8);

Type Parameters

T1

The type of the value tuple's first component.

T2

The type of the value tuple's second component.

T3

The type of the value tuple's third component.

T4

The type of the value tuple's fourth component.

T5

The type of the value tuple's fifth component.

T6

The type of the value tuple's sixth component.

T7

The type of the value tuple's seventh component.

T8

The type of the value tuple's eighth component.

Parameters

item1
T1

The value of the value tuple's first component.

item2
T2

The value of the value tuple's second component.

item3
T3

The value of the value tuple's third component.

item4
T4

The value of the value tuple's fourth component.

item5
T5

The value of the value tuple's fifth component.

item6
T6

The value of the value tuple's sixth component.

item7
T7

The value of the value tuple's seventh component.

item8
T8

The value of the value tuple's eighth component.

Returns

ValueTuple<T1,T2,T3,T4,T5,T6,T7,ValueTuple<T8>>

A value tuple with 8 components.

Remarks

Create is a helper method that you can call to instantiate an 8-component value tuple without having to explicitly specify the types of its components.

Note

You must call the ValueTuple<T1,T2,T3,T4,T5,T6,T7,TRest> constructor to create a tuple with nine or more components unless your language provides a special syntax for this purpose. The static methods of the ValueTuple structure cannot be used to create a tuple with nine or more components.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Create<T1,T2,T3,T4,T5,T6,T7>(T1, T2, T3, T4, T5, T6, T7)

Source:
ValueTuple.cs
Source:
ValueTuple.cs
Source:
ValueTuple.cs

Creates a new value tuple with 7 components (a septuple).

C#
public static(T1, T2, T3, T4, T5, T6, T7) Create<T1,T2,T3,T4,T5,T6,T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7);

Type Parameters

T1

The type of the value tuple's first component.

T2

The type of the value tuple's second component.

T3

The type of the value tuple's third component.

T4

The type of the value tuple's fourth component.

T5

The type of the value tuple's fifth component.

T6

The type of the value tuple's sixth component.

T7

The type of the value tuple's seventh component.

Parameters

item1
T1

The value of the value tuple's first component.

item2
T2

The value of the value tuple's second component.

item3
T3

The value of the value tuple's third component.

item4
T4

The value of the value tuple's fourth component.

item5
T5

The value of the value tuple's fifth component.

item6
T6

The value of the value tuple's sixth component.

item7
T7

The value of the value tuple's seventh component.

Returns

A value tuple with 7 components.

Remarks

Create is a helper method that you can call to instantiate an 7-component value tuple without having to explicitly specify the types of its components.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Create<T1,T2,T3,T4,T5,T6>(T1, T2, T3, T4, T5, T6)

Source:
ValueTuple.cs
Source:
ValueTuple.cs
Source:
ValueTuple.cs

Creates a new value tuple with 6 components (a sexuple).

C#
public static(T1, T2, T3, T4, T5, T6) Create<T1,T2,T3,T4,T5,T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6);

Type Parameters

T1

The type of the value tuple's first component.

T2

The type of the value tuple's second component.

T3

The type of the value tuple's third component.

T4

The type of the value tuple's fourth component.

T5

The type of the value tuple's fifth component.

T6

The type of the value tuple's sixth component.

Parameters

item1
T1

The value of the value tuple's first component.

item2
T2

The value of the value tuple's second component.

item3
T3

The value of the value tuple's third component.

item4
T4

The value of the value tuple's fourth component.

item5
T5

The value of the value tuple's fifth component.

item6
T6

The value of the value tuple's sixth component.

Returns

A value tuple with 6 components.

Remarks

Create is a helper method that you can call to instantiate a 6-component value tuple without having to explicitly specify the types of its components.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Create<T1,T2,T3,T4,T5>(T1, T2, T3, T4, T5)

Source:
ValueTuple.cs
Source:
ValueTuple.cs
Source:
ValueTuple.cs

Creates a new value tuple with 5 components (a quintuple).

C#
public static(T1, T2, T3, T4, T5) Create<T1,T2,T3,T4,T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5);

Type Parameters

T1

The type of the value tuple's first component.

T2

The type of the value tuple's second component.

T3

The type of the value tuple's third component.

T4

The type of the value tuple's fourth component.

T5

The type of the value tuple's fifth component.

Parameters

item1
T1

The value of the value tuple's first component.

item2
T2

The value of the value tuple's second component.

item3
T3

The value of the value tuple's third component.

item4
T4

The value of the value tuple's fourth component.

item5
T5

The value of the value tuple's fifth component.

Returns

A value tuple with 5 components.

Remarks

Create is a helper method that you can call to instantiate a 5-component value tuple without having to explicitly specify the types of its components.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Create<T1,T2,T3,T4>(T1, T2, T3, T4)

Source:
ValueTuple.cs
Source:
ValueTuple.cs
Source:
ValueTuple.cs

Creates a new value tuple with 4 components (a quadruple).

C#
public static(T1, T2, T3, T4) Create<T1,T2,T3,T4>(T1 item1, T2 item2, T3 item3, T4 item4);

Type Parameters

T1

The type of the value tuple's first component.

T2

The type of the value tuple's second component.

T3

The type of the value tuple's third component.

T4

The type of the value tuple's fourth component.

Parameters

item1
T1

The value of the value tuple's first component.

item2
T2

The value of the value tuple's second component.

item3
T3

The value of the value tuple's third component.

item4
T4

The value of the value tuple's fourth component.

Returns

A value tuple with 4 components.

Remarks

Create is a helper method that you can call to instantiate an 4-component value tuple without having to explicitly specify the types of its components.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Create<T1,T2,T3>(T1, T2, T3)

Source:
ValueTuple.cs
Source:
ValueTuple.cs
Source:
ValueTuple.cs

Creates a new value tuple with 3 components (a triple).

C#
public static(T1, T2, T3) Create<T1,T2,T3>(T1 item1, T2 item2, T3 item3);

Type Parameters

T1

The type of the value tuple's first component.

T2

The type of the value tuple's second component.

T3

The type of the value tuple's third component.

Parameters

item1
T1

The value of the value tuple's first component.

item2
T2

The value of the value tuple's second component.

item3
T3

The value of the value tuple's third component.

Returns

A value tuple with 3 components.

Remarks

Create is a helper method that you can call to instantiate an 3-component value tuple without having to explicitly specify the types of its components.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Create<T1,T2>(T1, T2)

Source:
ValueTuple.cs
Source:
ValueTuple.cs
Source:
ValueTuple.cs

Creates a new value tuple with 2 components (a pair).

C#
public static(T1, T2) Create<T1,T2>(T1 item1, T2 item2);

Type Parameters

T1

The type of the value tuple's first component.

T2

The type of the value tuple's second component.

Parameters

item1
T1

The value of the value tuple's first component.

item2
T2

The value of the value tuple's second component.

Returns

A value tuple with 2 components.

Remarks

Create is a helper method that you can call to instantiate an 2-component value tuple without having to explicitly specify the types of its components.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Create<T1>(T1)

Source:
ValueTuple.cs
Source:
ValueTuple.cs
Source:
ValueTuple.cs

Creates a new value tuple with 1 component (a singleton).

C#
public static(T1) Create<T1>(T1 item1);

Type Parameters

T1

The type of the value tuple's only component.

Parameters

item1
T1

The value of the value tuple's only component.

Returns

A value tuple with 1 component.

Remarks

Create is a helper method that you can call to instantiate a 1-component value tuple without having to explicitly specify the type of its component.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1