static void Main(string[] args) { (int, string)myTuple1 = (1, "1"); Console.WriteLine($"Type: {myTuple1.GetType()} , Base Type: {myTuple1.GetType().BaseType}"); ValueTuple <int, string> myTuple2 = new ValueTuple <int, string>(2, "2"); Console.WriteLine($"Type: {myTuple2.GetType()} , Base Type: {myTuple2.GetType().BaseType}"); Tuple <int, string> myTuple3 = new Tuple <int, string>(3, "3"); Console.WriteLine($"Type: {myTuple3.GetType()} , Base Type: {myTuple3.GetType().BaseType}"); Console.WriteLine(ReturnTuple()); Console.ReadLine(); }
public static void Main() { var x = (1, 2); Console.WriteLine(x.GetType()); x = new ValueTuple <int, int>(1, 2); Console.WriteLine(x.GetType()); var y = (1, 2, 3, 4, 5, 6, 7); Console.WriteLine(y.GetType()); var z = (1, 2, 3, 4, 5, 6, 7, 8); Console.WriteLine(z.GetType()); var w = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); Console.WriteLine(w.GetType()); }
public static Type GetValue(this ValueTuple value) { return(value.GetType()); }