TupleHelper

Ecng.Common

Provides helper methods for working with tuple types.

Methods

IsTuple
public static bool IsTuple(Type tupleType)
result = TupleHelper.IsTuple(tupleType)

Determines whether the specified type is a tuple type.

tupleType
The type to check.

Returns: true if the specified type is a tuple; otherwise, false.

ToTuple
public static object ToTuple(IEnumerable<object> values, bool isValue)
result = TupleHelper.ToTuple(values, isValue)

Creates a tuple from the provided collection of values.

values
An enumerable collection of values.
isValue
If set to true, a ValueTuple is created; otherwise, a Tuple is created.

Returns: The created tuple.

ToValues``1
public static IEnumerable<object> ToValues<T>(Tuple<T> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a Tuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``1
public static IEnumerable<object> ToValues<T>(ValueTuple<T> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a ValueTuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``1
public static IEnumerable<object> ToValues<T>(T tuple)
result = TupleHelper.ToValues(tuple)

Extracts the values of a tuple instance into an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``2
public static IEnumerable<object> ToValues<T1, T2>(Tuple<T1, T2> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a Tuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``2
public static IEnumerable<object> ToValues<T1, T2>(ValueTuple<T1, T2> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a ValueTuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``3
public static IEnumerable<object> ToValues<T1, T2, T3>(Tuple<T1, T2, T3> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a Tuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``3
public static IEnumerable<object> ToValues<T1, T2, T3>(ValueTuple<T1, T2, T3> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a ValueTuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``4
public static IEnumerable<object> ToValues<T1, T2, T3, T4>(Tuple<T1, T2, T3, T4> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a Tuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``4
public static IEnumerable<object> ToValues<T1, T2, T3, T4>(ValueTuple<T1, T2, T3, T4> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a ValueTuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``5
public static IEnumerable<object> ToValues<T1, T2, T3, T4, T5>(Tuple<T1, T2, T3, T4, T5> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a Tuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``5
public static IEnumerable<object> ToValues<T1, T2, T3, T4, T5>(ValueTuple<T1, T2, T3, T4, T5> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a ValueTuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``6
public static IEnumerable<object> ToValues<T1, T2, T3, T4, T5, T6>(Tuple<T1, T2, T3, T4, T5, T6> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a Tuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

ToValues``6
public static IEnumerable<object> ToValues<T1, T2, T3, T4, T5, T6>(ValueTuple<T1, T2, T3, T4, T5, T6> tuple)
result = TupleHelper.ToValues(tuple)

Returns the values of a ValueTuple as an enumerable collection.

tuple
The tuple instance.

Returns: An enumerable collection of tuple element values.

UnwrapExceptions
public static IEnumerable<Exception> UnwrapExceptions(Exception exception)
result = TupleHelper.UnwrapExceptions(exception)

Recursively unwraps all inner exceptions from the provided exception.

exception
The exception to unwrap.

Returns: An enumerable collection of exceptions, including the original exception and all nested inner exceptions.