コード例 #1
0
        public CoursesData(ELearningPlatformContext context)
        {
            _context = context;

            if (_context.Course.Count() == 0)
            {
                // Create a new User if collection is empty,
                // which means you can't delete all users.
                _context.Course.AddRange(new Course {
                    Name = "Test", Desc = "Test course", CreationDate = DateTime.Now, Ico = "./img/Ico/16.jpg", IdInstructor = 11, IdSubject = 1
                }, new Course {
                    Name = "Test2", Desc = "Test course", CreationDate = DateTime.Now, Ico = "./img/Ico/16.jpg", IdInstructor = 11, IdSubject = 1
                }, new Course {
                    Name = "Test3", Desc = "Test course", CreationDate = DateTime.Now, Ico = "./img/Ico/16.jpg", IdInstructor = 11, IdSubject = 1
                });
            }
            if (_context.Inscription.Count() == 0)
            {
                _context.Inscription.Add(new Inscription {
                    IdCourse = 8, IdUser = 11
                });
            }
            _context.SaveChanges();
        }
コード例 #2
0
 public UsersData(ELearningPlatformContext context)
 {
     _context = context;
 }
コード例 #3
0
 public ModuleData(ELearningPlatformContext context)
 {
     _context = context;
 }
コード例 #4
0
 public SubjectData(ELearningPlatformContext context)
 {
     _context = context;
 }