MicroLite.Mapping.TupleObjectInfo.GetTupleType C# (CSharp) Method

GetTupleType() private static method

private static GetTupleType ( Type fieldTypes ) : Type
fieldTypes System.Type
return System.Type
        private static Type GetTupleType(Type[] fieldTypes)
        {
            switch (fieldTypes.Length)
            {
                case 1:
                    return typeof(Tuple<>).MakeGenericType(fieldTypes);

                case 2:
                    return typeof(Tuple<,>).MakeGenericType(fieldTypes);

                case 3:
                    return typeof(Tuple<,,>).MakeGenericType(fieldTypes);

                case 4:
                    return typeof(Tuple<,,,>).MakeGenericType(fieldTypes);

                case 5:
                    return typeof(Tuple<,,,,>).MakeGenericType(fieldTypes);

                case 6:
                    return typeof(Tuple<,,,,,>).MakeGenericType(fieldTypes);

                case 7:
                    return typeof(Tuple<,,,,,,>).MakeGenericType(fieldTypes);

                default:
                    throw new NotSupportedException(ExceptionMessages.TupleObjectInfo_TupleNotSupported);
            }
        }