Esempio n. 1
0
        // Constructor methods
        public DevFluffDataStore(string dbFilePath, IDataStoreSeeder seeder = null)
        {
            // todo: ensure we have trailing /
            ScriptsRootDir = "./DevFluffDataStore/";
            DatabasePath = dbFilePath;
            _seeder = seeder;
            _assembly = Assembly.GetExecutingAssembly();
            _providerName = "SQLite";

            _queryCache = new Dictionary<string, string>();
            _instanceCache = new Dictionary<string, DataStoreInstance>();

            OpenDatabaseConnection();
        }
Esempio n. 2
0
        public DevFluffDataStore(IDbConnection dbConnection, IDataStoreSeeder seeder = null)
        {
            // todo: ensure we have trailing /
            ScriptsRootDir = "./DevFluffDataStore/";
            DatabasePath = string.Empty;
            _seeder = seeder;
            _assembly = Assembly.GetExecutingAssembly();
            _providerName = "SQL";
            
            _queryCache = new Dictionary<string, string>();
            _instanceCache = new Dictionary<string, DataStoreInstance>();

            _dbConnection = dbConnection;

            if (_dbConnection.State != ConnectionState.Open)
            {
                _dbConnection.Open();
            }
        }