Ejemplo n.º 1
0
        internal static DbInfo GetDbInfo <T>() where T : class
        {
            DbInfo db;

            lock (_dbInfos)
            {
                if (_dbInfos.TryGetValue(typeof(T), out db))
                {
                    return(db.Clone());
                }
            }

            var checkRecursive = new List <Type>();

            db = new DbInfo();
            foreach (var column in FindColumns <T>(typeof(T), new string[0], new string[0], checkRecursive))
            {
                db.Add(column);
            }

            lock (_dbInfos)
            {
                if (!_dbInfos.ContainsKey(typeof(T)))
                {
                    _dbInfos.Add(typeof(T), db);
                }
            }
            return(db);
        }
Ejemplo n.º 2
0
 internal DbInfo Clone()
 {
     var clone = new DbInfo();
     clone._lambdaNameAndColumn = _lambdaNameAndColumn.ToDictionary(e => e.Key, e => e.Value);
     clone._lambdaNameAndTable = _lambdaNameAndTable.ToDictionary(e => e.Key, e => e.Value);
     return clone;
 }
Ejemplo n.º 3
0
        internal DbInfo Clone()
        {
            var clone = new DbInfo();

            clone._lambdaNameAndColumn = _lambdaNameAndColumn.ToDictionary(e => e.Key, e => e.Value);
            clone._lambdaNameAndTable  = _lambdaNameAndTable.ToDictionary(e => e.Key, e => e.Value);
            clone._lambdaNameSchema    = _lambdaNameSchema.ToDictionary(e => e.Key, e => e.Value);
            return(clone);
        }