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]);
 }
예제 #2
0
파일: SqlSer.cs 프로젝트: pgovind/runtime
        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);
        }