void Init() { TestMode = this._db.DataProvider.ConnectionString.Equals("test", StringComparison.InvariantCultureIgnoreCase); _dirtyColumns = new List <IColumn>(); if (TestMode) { PagePowerSign.SetTestRepo(); _repo = _testRepo; } else { _repo = new SubSonicRepository <PagePowerSign>(_db); } tbl = _repo.GetTable(); SetIsNew(true); OnCreated(); }
internal static IRepository <PagePowerSign> 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 <PagePowerSign> _repo; if (db.TestMode) { PagePowerSign.SetTestRepo(); _repo = _testRepo; } else { _repo = new SubSonicRepository <PagePowerSign>(db); } return(_repo); }