public static void Setup(int testItems) { SetTestRepo(); for (int i = 0; i < testItems; i++) { SYS_PARAMATERS item = new SYS_PARAMATERS(); _testRepo._items.Add(item); } }
public override bool Equals(object obj) { if (obj.GetType() == typeof(SYS_PARAMATERS)) { SYS_PARAMATERS compare = (SYS_PARAMATERS)obj; return(compare.KeyValue() == this.KeyValue()); } else { return(base.Equals(obj)); } }
public static SYS_PARAMATERS SingleOrDefault(Expression <Func <SYS_PARAMATERS, bool> > expression, string connectionString, string providerName) { var repo = GetRepo(connectionString, providerName); var results = repo.Find(expression); SYS_PARAMATERS single = null; if (results.Count() > 0) { single = results.ToList()[0]; } return(single); }
public static SYS_PARAMATERS SingleOrDefault(Expression <Func <SYS_PARAMATERS, bool> > expression) { var repo = GetRepo(); var results = repo.Find(expression); SYS_PARAMATERS 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) { SYS_PARAMATERS.SetTestRepo(); _repo = _testRepo; } else { _repo = new SubSonicRepository <SYS_PARAMATERS>(_db); } tbl = _repo.GetTable(); SetIsNew(true); OnCreated(); }
internal static IRepository <SYS_PARAMATERS> 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 <SYS_PARAMATERS> _repo; if (db.TestMode) { SYS_PARAMATERS.SetTestRepo(); _repo = _testRepo; } else { _repo = new SubSonicRepository <SYS_PARAMATERS>(db); } return(_repo); }
public static void Setup(SYS_PARAMATERS item) { SetTestRepo(); _testRepo._items.Add(item); }