예제 #1
0
        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();
        }
예제 #2
0
파일: tuple.cs 프로젝트: raulgarciamsft/ql
    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());
    }
예제 #3
0
 public static Type GetValue(this ValueTuple value)
 {
     return(value.GetType());
 }