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