예제 #1
0
        public ITableManager GetManager(TableSchema schema)
        {
            ITableManager mgr = null;

            if (myManagers.ContainsKey(schema.Name))
            {
                mgr = myManagers[schema.Name];
            }
            else if (schema.IsPersistent)
            {
                mgr = new PersistentTableManager(myPersistentDB, schema);
                myManagers.Add(schema.Name, mgr);
            }
            else
            {
                mgr = new InMemoryTableManager(myInMemoryDB, schema);
                myManagers.Add(schema.Name, mgr);
            }

            return(mgr);
        }
예제 #2
0
        public ITableManager GetManager(string tableName)
        {
            ITableManager mgr = null;

            if (myManagers.ContainsKey(tableName))
            {
                mgr = myManagers[tableName];
            }
            else if (myInMemoryDB.Tables.Contains(tableName))
            {
                mgr = new InMemoryTableManager(myInMemoryDB, myInMemoryDB.Tables[tableName]);
                myManagers.Add(tableName, mgr);
            }
            else if (myPersistentDB.ExistsTable(tableName))
            {
                mgr = new PersistentTableManager(myPersistentDB, tableName);
                myManagers.Add(tableName, mgr);
            }

            return(mgr);
        }