void Init() { TestMode = this._db.DataProvider.ConnectionString.Equals("test", StringComparison.InvariantCultureIgnoreCase); _dirtyColumns = new List <IColumn>(); if (TestMode) { Taxa.SetTestRepo(); _repo = _testRepo; } else { _repo = new SubSonicRepository <Taxa>(_db); } tbl = _repo.GetTable(); SetIsNew(true); OnCreated(); }
internal static IRepository <Taxa> GetRepo(string connectionString, string providerName) { SpeciesSolution.DataAccess.DataModel.SpeciesDB db; if (String.IsNullOrEmpty(connectionString)) { db = new SpeciesSolution.DataAccess.DataModel.SpeciesDB(); } else { db = new SpeciesSolution.DataAccess.DataModel.SpeciesDB(connectionString, providerName); } IRepository <Taxa> _repo; if (db.TestMode) { Taxa.SetTestRepo(); _repo = _testRepo; } else { _repo = new SubSonicRepository <Taxa>(db); } return(_repo); }