public static void EnsurePopulated(IApplicationBuilder app)
        {
            FFDbContext context = app.ApplicationServices.CreateScope().ServiceProvider
                                  .GetRequiredService <FFDbContext>();

            if (context.Database.GetPendingMigrations().Any())
            {
                context.Database.Migrate();
            }

            if (!context.StudentsSubjects.Any())
            {
                context.StudentsSubjects.AddRange(
                    new StudentsSubjects {
                    StudentID = 1, SubjectID = 1
                },
                    new StudentsSubjects {
                    StudentID = 2, SubjectID = 1
                },
                    new StudentsSubjects {
                    StudentID = 3, SubjectID = 2
                }
                    );
            }
            context.SaveChanges();
        }
        public static void EnsurePopulated(IApplicationBuilder app)
        {
            FFDbContext context = app.ApplicationServices.CreateScope().ServiceProvider
                                  .GetRequiredService <FFDbContext>();

            if (context.Database.GetPendingMigrations().Any())
            {
                context.Database.Migrate();
            }

            if (!context.Subjects.Any())
            {
                context.Subjects.AddRange(
                    new Subject {
                    Name = "DMU-19 ProTek3"
                },
                    new Subject {
                    Name = "DMU-19 Sysudvikling3"
                },
                    new Subject {
                    Name = "DMU-19 Databaser"
                },
                    new Subject {
                    Name = "DMU-20 ProTek3"
                },
                    new Subject {
                    Name = "DMU-20 Sysudvikling3"
                },
                    new Subject {
                    Name = "DMU-20 Databaser"
                }
                    );
            }
            context.SaveChanges();
        }
        public static void EnsurePopulated(IApplicationBuilder app)
        {
            FFDbContext context = app.ApplicationServices.CreateScope().ServiceProvider
                                  .GetRequiredService <FFDbContext>();

            if (context.Database.GetPendingMigrations().Any())
            {
                context.Database.Migrate();
            }

            if (!context.Protocols.Any())
            {
                context.Protocols.AddRange(
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 1, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 2, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 3, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 4, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 5, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 6, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 7, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 8, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 9, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 10, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 11, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 12, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 13, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 14, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 15, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 16, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 17, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 18, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 19, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 20, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("10-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 21, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 1, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 2, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 3, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 4, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 5, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 6, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 7, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 8, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 9, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 10, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 11, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 12, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 13, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 14, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 15, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 16, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 17, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 18, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 19, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("11-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 20, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 21, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 1, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 2, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 3, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 4, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 5, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 6, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 7, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 8, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 9, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 10, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 11, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 12, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 13, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 14, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 15, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 16, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 17, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 18, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 19, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 20, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("12-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 21, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 1, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 2, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 3, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 4, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 5, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 6, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 7, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 8, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 9, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 10, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 11, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 12, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 13, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 14, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 15, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 16, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 17, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 18, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 2, HoursVirtual = 0, StudentID = 19, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 2, StudentID = 20, SubjectID = 1
                },
                    new Protocol {
                    Date = DateTime.Parse("13-12-2020"), HoursTotal = 2, HoursPresent = 0, HoursVirtual = 0, StudentID = 21, SubjectID = 1
                }
                    );
            }
            context.SaveChanges();
        }
        public static void EnsurePopulated(IApplicationBuilder app)
        {
            FFDbContext context = app.ApplicationServices.CreateScope().ServiceProvider
                                  .GetRequiredService <FFDbContext>();

            if (context.Database.GetPendingMigrations().Any())
            {
                context.Database.Migrate();
            }

            if (!context.Students.Any())
            {
                context.Students.AddRange(
                    new Student {
                    Name = "Bjarke Villadsen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Casper Nielsen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Christian Nygaard Pedersen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Claus Jørgensen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Daniel Bjerre Madsen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Dean Marco Dalager Birch Nielsen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Emil Overgaard Jensen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Jack Jakobsen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Jakob Rasmussen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Mads Brandt", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Mark Enggaard", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Mark Pearson", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Martin Godthaab Larsen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Mathias Jensen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Pia Degn Eriksen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Sabine Amtkjær", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Simon Markussen", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Søren Kaalund", Email = "sø[email protected]", IsActive = true
                },
                    new Student {
                    Name = "Victor Eriksen Siig", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Viktor Juul", Email = "*****@*****.**", IsActive = true
                },
                    new Student {
                    Name = "Yasin Güler", Email = "*****@*****.**", IsActive = true
                }
                    );
            }
            context.SaveChanges();
        }
 public StudentsSubjectsRepository(FFDbContext ctx)
 {
     context = ctx;
 }
 public ProtocolRepository(FFDbContext ctx)
 {
     context = ctx;
 }
 public SubjectRepository(FFDbContext ctx)
 {
     context = ctx;
 }
Beispiel #8
0
 public StudentRepository(FFDbContext ctx)
 {
     context = ctx;
 }