// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app, GdprDbContext dbContext)
 {
     app.UseGraphQL <GdprSchema>();
     app.UseGraphQLPlayground(new GraphQLPlaygroundOptions());
     dbContext.Database.Migrate();
     dbContext.Seed();
 }
Exemple #2
0
        public static void Seed(this GdprDbContext context)
        {
            if (!context.Persons.Any())
            {
                context.Persons.Add(new Person
                {
                    FirstName   = "Henk",
                    LastName    = "De Vries",
                    StreetName  = "Steenstraat",
                    HouseNumber = "10E"
                });

                context.Persons.Add(new Person
                {
                    FirstName   = "Bram",
                    LastName    = "Jansen",
                    StreetName  = "Wagenstraat",
                    HouseNumber = "22A"
                });

                context.Persons.Add(new Person
                {
                    FirstName   = "Sean",
                    LastName    = "De Jong",
                    StreetName  = "Haarlemmerstraat",
                    HouseNumber = "66Q"
                });

                context.SaveChanges();
            }
        }