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