About 1,410,000 results
Open links in new tab
  1. c# - What and When to use Tuple? - Stack Overflow

    Nov 30, 2012 · A tuple allows you to combine multiple values of possibly different types into a single object without having to create a custom class. This can be useful if you want to write a method that …

  2. c# - What's the difference between System.ValueTuple and …

    The difference between Tuple and ValueTuple is that Tuple is a reference type and ValueTuple is a value type. The latter is desirable because changes to the language in C# 7 have tuples being used …

  3. How to use c# tuple value types in a switch statement

    Jun 4, 2017 · I'm using the new tuple value types in .net 4.7. In this example I am trying to make a switch statement for one or more cases of a tuple: using System; namespace ValueTupleTest { class …

  4. c# - How to name tuple properties? - Stack Overflow

    How and "could be" organized return from the method which returns tuple type with the name of parameters, as an example private static Tuple<string, string> methodTuple() { return new {N...

  5. C# Define a tuple as type - Stack Overflow

    Jul 31, 2022 · protected virtual IEnumerable<(string, string)> GetConfigs() that will be overridden by each child class. I'm looking for a way to define that tuple as type to declare the return type as …

  6. When to use: Tuple vs Class in C# 7.0 - Stack Overflow

    Jun 20, 2017 · Tuple is a great option when you want to combine multiple values (can be different types) into one object without creating a custom class. In this case, Tuple would be a fast and a perfect …

  7. c# - How to easily initialize a list of Tuples? - Stack Overflow

    C# 7 will be adding in support for tuples built into the language, though they will be of a different type (System.ValueTuple instead). So to it would be good to add overloads for value tuples so you have …

  8. c# - Tuple.Create () vs new Tuple - Stack Overflow

    Dec 13, 2014 · new Tuple<int,int>(1,2); Tuple.Create(1,2); Is there any difference between these two methods of Tuple creation? From my reading it seems to be more a convenient shorthand than …

  9. c# - Return multiple values to a method caller - Stack Overflow

    @Jakob isn't out the closest thing C# has to native multiple return? The tuple probably is the best option for readability. Personally, I'm not keen on having anonymous types or property names like Item1 - …

  10. c# Tuple - What is a practical use of Tuple - Stack Overflow

    A Tuple is counter-part to a List. While a List stores 0-N of the same type of item, a Tuple store 1-M of (possibly) different -typed items, where N is unbounded and M is statically fixed/defined. Each of …