예제 #1
0
 public static void Setup(int testItems)
 {
     SetTestRepo();
     for (int i = 0; i < testItems; i++)
     {
         OUT_BACK01 item = new OUT_BACK01();
         _testRepo._items.Add(item);
     }
 }
예제 #2
0
 public override bool Equals(object obj)
 {
     if (obj.GetType() == typeof(OUT_BACK01))
     {
         OUT_BACK01 compare = (OUT_BACK01)obj;
         return(compare.KeyValue() == this.KeyValue());
     }
     else
     {
         return(base.Equals(obj));
     }
 }
예제 #3
0
        public static OUT_BACK01 SingleOrDefault(Expression <Func <OUT_BACK01, bool> > expression, string connectionString, string providerName)
        {
            var        repo    = GetRepo(connectionString, providerName);
            var        results = repo.Find(expression);
            OUT_BACK01 single  = null;

            if (results.Count() > 0)
            {
                single = results.ToList()[0];
            }

            return(single);
        }
예제 #4
0
        public static OUT_BACK01 SingleOrDefault(Expression <Func <OUT_BACK01, bool> > expression)
        {
            var        repo    = GetRepo();
            var        results = repo.Find(expression);
            OUT_BACK01 single  = null;

            if (results.Count() > 0)
            {
                single = results.ToList()[0];
                single.OnLoaded();
                single.SetIsLoaded(true);
                single.SetIsNew(false);
            }

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

            if (db.TestMode)
            {
                OUT_BACK01.SetTestRepo();
                _repo = _testRepo;
            }
            else
            {
                _repo = new SubSonicRepository <OUT_BACK01>(db);
            }
            return(_repo);
        }
예제 #7
0
 public static void Setup(OUT_BACK01 item)
 {
     SetTestRepo();
     _testRepo._items.Add(item);
 }