// 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(); }
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(); } }