public static void Main(string[] args) { Database.SetInitializer(new MigrateDatabaseToLatestVersion <SchoolSystemContext, Configuration>()); using (var db = new SchoolSystemContext()) { var student = new Student { Name = "gosho", Number = "its not a f*****g null" }; db.Students.Add(student); ImportStudents(db); ImportCourses(db); ImportHomeworks(db); db.SaveChanges(); Console.WriteLine(db.Students.Count()); Console.WriteLine(db.Homeworks.Count()); Console.WriteLine(db.Courses.Count()); } }
static void Main() { var context = new SchoolSystemContext(); context.Database.Initialize(true); }
public StudentsController(SchoolSystemContext context) { _context = context; }
public TeachersController(IDirectorTeachersService service) { this.context = new SchoolSystemContext(); this.service = service; }
public UserService(SchoolSystemContext context) { _context = context; }
public StudentController(SchoolSystemContext context) { dbContext = context; }