예제 #1
0
        public static string GetConnName(Type type)
        {
            MapTableAttribute table = GetTable(type);

            if ((table != null) && !string.IsNullOrEmpty(table.ConnName))
            {
                return(table.ConnName);
            }
            return(null);
        }
예제 #2
0
 public static MapTableAttribute GetTable(Type type)
 {
     if (_Tables.ContainsKey(type))
     {
         return(_Tables[type]);
     }
     lock (_Tables)
     {
         if (_Tables.ContainsKey(type))
         {
             return(_Tables[type]);
         }
         MapTableAttribute customAttribute = MapTableAttribute.GetCustomAttribute(type);
         _Tables.Add(type, customAttribute);
         return(customAttribute);
     }
 }