Class Tupler
- Namespace
- Dynamitey
- Assembly
- Dynamitey.Community.dll
Dynamically Dealing with Tuples
public static class Tupler
- Inheritance
-
Tupler
- Inherited Members
Methods
Create(params object[])
Creates a Tuple with arg runtime types.
[RequiresUnreferencedCode("Forwards to ToTuple, which resolves System.Tuple.Create via the DLR binder; trimming can remove the overload being resolved.")]
[RequiresDynamicCode("Binds through the DLR (directly or via InvokeHelper.TupleItem/InvokeMember), which requires runtime code generation; not supported when AOT-compiled.")]
public static dynamic Create(params object[] args)
Parameters
argsobject[]The args.
Returns
- dynamic
First(object)
Firsts item of the specified tuple.
[RequiresUnreferencedCode("Forwards to Index, which reads tuple.ItemN/tuple.Rest via InvokeHelper.TupleItem or 'dynamic' member access; trimming can remove those properties.")]
[RequiresDynamicCode("Binds through the DLR (directly or via InvokeHelper.TupleItem/InvokeMember), which requires runtime code generation; not supported when AOT-compiled.")]
public static dynamic First(object tuple)
Parameters
tupleobjectThe tuple.
Returns
- dynamic
Index(object, int)
Gets value at the index of the specified tuple.
[RequiresUnreferencedCode("Forwards to HelperIndex, which reads tuple.ItemN/tuple.Rest via InvokeHelper.TupleItem or 'dynamic' member access; trimming can remove those properties.")]
[RequiresDynamicCode("Binds through the DLR (directly or via InvokeHelper.TupleItem/InvokeMember), which requires runtime code generation; not supported when AOT-compiled.")]
public static dynamic Index(object tuple, int index)
Parameters
Returns
- dynamic
Exceptions
- ArgumentException
index must be greater than or equal to 0;index
IsTuple(object?)
Determines whether the specified target is a tuple.
public static bool IsTuple(object? target)
Parameters
targetobjectThe target.
Returns
- bool
trueif the specified target is tuple; otherwise,false.
Last(object)
Lasts item of the specified tuple.
[RequiresUnreferencedCode("Forwards to Index, which reads tuple.ItemN/tuple.Rest via InvokeHelper.TupleItem or 'dynamic' member access; trimming can remove those properties.")]
[RequiresDynamicCode("Binds through the DLR (directly or via InvokeHelper.TupleItem/InvokeMember), which requires runtime code generation; not supported when AOT-compiled.")]
public static dynamic Last(object tuple)
Parameters
tupleobjectThe tuple.
Returns
- dynamic
Second(object)
Second item of the specified tuple.
[RequiresUnreferencedCode("Forwards to Index, which reads tuple.ItemN/tuple.Rest via InvokeHelper.TupleItem or 'dynamic' member access; trimming can remove those properties.")]
[RequiresDynamicCode("Binds through the DLR (directly or via InvokeHelper.TupleItem/InvokeMember), which requires runtime code generation; not supported when AOT-compiled.")]
public static dynamic Second(object tuple)
Parameters
tupleobjectThe tuple.
Returns
- dynamic
Size(object)
Gets the size of the tuple
public static int Size(object tuple)
Parameters
tupleobjectThe tuple.
Returns
ToList(object)
Convert to list.
[RequiresUnreferencedCode("Calls HelperToList, which reads tuple.ItemN/tuple.Rest via InvokeHelper.TupleItem or 'dynamic' member access; trimming can remove those properties.")]
[RequiresDynamicCode("Binds through the DLR (directly or via InvokeHelper.TupleItem/InvokeMember), which requires runtime code generation; not supported when AOT-compiled.")]
public static IList<dynamic> ToList(object tuple)
Parameters
tupleobjectThe tuple.
Returns
ToTuple(IEnumerable)
Enumerable to tuple.
[RequiresUnreferencedCode("Resolves System.Tuple.Create (an 8-arity private TuplerFix.Create for >7 items) via Dynamic.InvokeMember/the DLR binder; trimming can remove the overload being resolved.")]
[RequiresDynamicCode("Binds through the DLR (directly or via InvokeHelper.TupleItem/InvokeMember), which requires runtime code generation; not supported when AOT-compiled.")]
public static dynamic ToTuple(this IEnumerable enumerable)
Parameters
enumerableIEnumerableThe enumerable.
Returns
- dynamic