TupleHelper
Provides helper methods for working with tuple types.
Методы
public static bool IsTuple(Type tupleType)
result = TupleHelper.IsTuple(tupleType)
Determines whether the specified type is a tuple type.
- tupleType
- The type to check.
Возвращает: true if the specified type is a tuple; otherwise, false.
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.
Возвращает: The created tuple.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of tuple element values.
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.
Возвращает: An enumerable collection of exceptions, including the original exception and all nested inner exceptions.