Example #1
0
        public static void EnsurePopulated(IApplicationBuilder app)
        {
            docsdevEntities context = app.ApplicationServices
                                      .CreateScope().ServiceProvider.GetRequiredService <docsdevEntities>();

            if (context.Database.GetPendingMigrations().Any())
            {
                context.Database.Migrate();
            }
            if (!context.signer_employee.Any())
            {
                context.signer_employee.AddRange(
                    new signer_employee {
                    employee_id      = "1001",
                    employee_email   = "*****@*****.**",
                    employee_name    = "septian",
                    department_id    = "1",
                    lastnotification = DateTime.Now
                }
                    );
                context.SaveChanges();
            }
        }
 public EFDigiSignRepository(docsdevEntities ctx)
 {
     context = ctx;
 }