Tuples · TL;DR
1 min readTL;DR
A C# tuple (int Id, string Name) is syntax over System.ValueTuple<T1, T2>: a mutable struct with public fields Item1..Item7 plus Rest. Element names exist only at compile time (stored in [TupleElementNames] attributes on signatures), so they vanish at runtime, in reflection, in dynamic and in JSON serialization. Tuples use structural equality (== compares element by element since C# 7.3). A tuple is a composition of values, not an encapsulation: it groups them but cannot validate, hide or add behaviour to them. Reach for them for private helpers, multiple return values, LINQ intermediates, deconstruction and swaps; reach for a record (see the Records module) once the shape crosses a public API boundary or needs a name, validation or behaviour. The old System.Tuple<T1, T2> is a reference type with read-only properties and no language support: legacy only.