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

            if (db.TestMode)
            {
                UseLog.SetTestRepo();
                _repo = _testRepo;
            }
            else
            {
                _repo = new SubSonicRepository <UseLog>(db);
            }
            return(_repo);
        }