Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 3
0
 public StudentsController(SchoolSystemContext context)
 {
     _context = context;
 }
Ejemplo n.º 4
0
 public TeachersController(IDirectorTeachersService service)
 {
     this.context = new SchoolSystemContext();
     this.service = service;
 }
Ejemplo n.º 5
0
 public UserService(SchoolSystemContext context)
 {
     _context = context;
 }
Ejemplo n.º 6
0
 public StudentController(SchoolSystemContext context)
 {
     dbContext = context;
 }