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(); }
public UsersData(ELearningPlatformContext context) { _context = context; }
public ModuleData(ELearningPlatformContext context) { _context = context; }
public SubjectData(ELearningPlatformContext context) { _context = context; }