The Tuples introduced with C# 7 are not always a better choice; they are value types, which means if your passing back a reference type, its going to 'copied' leave a bigger memory footprint.
There is a reference type version too:
C# tuples, which are backed by System.ValueTuple types, are different from tuples that are represented by System.Tuple types. The main differences are as follows:
-System.ValueTuple types are value types. System.Tuple types are reference types.
-System.ValueTuple types are mutable. System.Tuple types are immutable.
-Data members of System.ValueTuple types are fields. Data members of System.Tuple types are properties.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The Tuples introduced with C# 7 are not always a better choice; they are value types, which means if your passing back a reference type, its going to 'copied' leave a bigger memory footprint.
There is a reference type version too:
C# tuples, which are backed by System.ValueTuple types, are different from tuples that are represented by System.Tuple types. The main differences are as follows:
-System.ValueTuple types are value types. System.Tuple types are reference types.
-System.ValueTuple types are mutable. System.Tuple types are immutable.
-Data members of System.ValueTuple types are fields. Data members of System.Tuple types are properties.