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

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

            return(single);
        }
コード例 #4
0
        public static EmailSendHistory SingleOrDefault(Expression <Func <EmailSendHistory, bool> > expression)
        {
            var repo                = GetRepo();
            var results             = repo.Find(expression);
            EmailSendHistory 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)
     {
         EmailSendHistory.SetTestRepo();
         _repo = _testRepo;
     }
     else
     {
         _repo = new SubSonicRepository <EmailSendHistory>(_db);
     }
     tbl = _repo.GetTable();
     SetIsNew(true);
     OnCreated();
 }
コード例 #6
0
        internal static IRepository <EmailSendHistory> 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 <EmailSendHistory> _repo;

            if (db.TestMode)
            {
                EmailSendHistory.SetTestRepo();
                _repo = _testRepo;
            }
            else
            {
                _repo = new SubSonicRepository <EmailSendHistory>(db);
            }
            return(_repo);
        }
コード例 #7
0
 public static void Setup(EmailSendHistory item)
 {
     SetTestRepo();
     _testRepo._items.Add(item);
 }