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

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

            return(single);
        }
        public static Inventory01 SingleOrDefault(Expression <Func <Inventory01, bool> > expression)
        {
            var         repo    = GetRepo();
            var         results = repo.Find(expression);
            Inventory01 single  = null;

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

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

            if (db.TestMode)
            {
                Inventory01.SetTestRepo();
                _repo = _testRepo;
            }
            else
            {
                _repo = new SubSonicRepository <Inventory01>(db);
            }
            return(_repo);
        }
 public static void Setup(Inventory01 item)
 {
     SetTestRepo();
     _testRepo._items.Add(item);
 }