internal static int GetUdtMaxLength(Type t)
        {
            SqlUdtInfo fromType = SqlUdtInfo.GetFromType(t);

            if (Format.Native == fromType.SerializationFormat)
            {
                return(SizeInBytes(t));
            }
            return(fromType.MaxByteSize);
        }
Exemple #2
0
        internal static int GetUdtMaxLength(Type t)
        {
            SqlUdtInfo udtInfo = SqlUdtInfo.GetFromType(t);

            if (Format.Native == udtInfo.SerializationFormat)
            {
                // In the native format, the user does not specify the
                // max byte size, it is computed from the type definition
                return(SizeInBytes(t));
            }
            else
            {
                // In all other formats, the user specifies the maximum size in bytes.
                return(udtInfo.MaxByteSize);
            }
        }