private void CopyTestStudents() { foreach (Student student in StudentData.TestStudents) { StudentInfoContext.Students.Add(student); StudentInfoContext.SaveChanges(); } }
public StudentInfoController(StudentInfoContext context) { _context = context; if (_context.StudentInfomations.Count() == 0) { _context.StudentInfomations.Add(new StudentInfo()); _context.SaveChanges(); } }
public StudentGradesWindowViewModel(Student student, StudentGradesWindow gradesWindow) { if (student == null) { student = new Student(); gradesWindow = new StudentGradesWindow(); } Student = student; context = new StudentInfoContext(); LoadStudentGrades(gradesWindow); }
public MainWindowVM() { Model = new StudentModel(); StudentInfoContext = new StudentInfoContext(); FillStudStatusChoices(); if (TestStudentsIfEmpty()) { CopyTestStudents(); } }