internal static SqlUserDefinedTypeAttribute GetUdtAttribute(Type t) { object[] customAttributes = GetCustomAttributes(t); if ((customAttributes == null) || (customAttributes.Length != 1)) { throw InvalidUdtException.Create(t, "SqlUdtReason_NoUdtAttribute"); } return((SqlUserDefinedTypeAttribute)customAttributes[0]); }
internal static SqlUserDefinedTypeAttribute GetUdtAttribute(Type t) { SqlUserDefinedTypeAttribute udtAttr = null; object[] attr = GetCustomAttributes(t); if (attr != null && attr.Length == 1) { udtAttr = (SqlUserDefinedTypeAttribute)attr[0]; } else { throw InvalidUdtException.Create(t, SR.SqlUdtReason_NoUdtAttribute); } return(udtAttr); }