Exemplo n.º 1
0
        public static string GetConnName(Type type)
        {
            MapTableAttribute table = GetTable(type);

            if ((table != null) && !string.IsNullOrEmpty(table.ConnName))
            {
                return(table.ConnName);
            }
            return(null);
        }
Exemplo n.º 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);
     }
 }