Example #1
0
 public void InitializeTest()
 {
     storage = new MixedCurriculumStorage(lmsService);
     using (context = lmsService.GetDbDataContext())
     {
         ClearDb();
     }
 }
Example #2
0
        protected virtual IDataContext GetDbContext()
        {
            var db = new DBDataContext();

#if DEBUG
            db.Log = this.Logger;
#endif

            return db;
        }
Example #3
0
 private void ClearDb()
 {
     context = lmsService.GetDbDataContext();
     context.CurriculumAssignments.DeleteAllOnSubmit(context.CurriculumAssignments);
     context.Themes.DeleteAllOnSubmit(context.Themes);
     context.Stages.DeleteAllOnSubmit(context.Stages);
     context.Curriculums.DeleteAllOnSubmit(context.Curriculums);
     context.CurriculumAssignments.DeleteAllOnSubmit(context.CurriculumAssignments);
     context.SubmitChanges();
 }
        protected virtual IDataContext GetDbContext()
        {
            var context = new DBDataContext();
            // context.DeferredLoadingEnabled = false;
#if DEBUG
            context.Log = this.logger;
#endif

            return context; // new DBDataContext();
        }
Example #5
0
 public CurriculumStorageTest()
 {
     lmsService = null;// new FakeLmsService();
     using (context = lmsService.GetDbDataContext())
     {
         if (context.DatabaseExists())
         {
             context.DeleteDatabase();
         }
         context.CreateDatabase();
         InitializeDb();
     }
 }
Example #6
0
        public DatabaseBanStorage(ILmsService lmsService, LinqLogger logger)
        {
            this.LmsService = lmsService;
            this.Logger = logger;
            this.CreateIDataContext = () =>
                {
                    var db = new DBDataContext();

#if DEBUG
                    db.Log = logger;
#endif

                    return db;
                };
        }
Example #7
0
 public void RefreshState()
 {
     _Db = _LmsService.GetDbDataContext();
 }
 private Theme GetTheme(int id, DBDataContext db)
 {
     return db.Themes.SingleOrDefault(item => item.Id == id && !item.IsDeleted);
 }
 public void RefreshState()
 {
     //db = new DBDataContext(lmsService.GetDbConnectionString());
     _Db = _LmsService.GetDbDataContext();
 }
Example #10
0
 public MixedCourseStorage(ILmsService lmsService)
 {
     db = lmsService.GetDBDataContext();
 }
Example #11
0
 public void RefreshState()
 {
     _Db = new DBDataContext();
 }