internal static int GetUdtMaxLength(Type t) { SqlUdtInfo fromType = SqlUdtInfo.GetFromType(t); if (Format.Native == fromType.SerializationFormat) { return(SizeInBytes(t)); } return(fromType.MaxByteSize); }
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); } }