예제 #1
0
        public static void GlowMigrateConfigurationSqlServer(this IServiceProvider serviceProvider)
        {
            using IServiceScope scope = serviceProvider.CreateScope();
            SqlServerConfigurationDataContext db =
                scope.ServiceProvider.GetRequiredService <SqlServerConfigurationDataContext>();

            db.Migrate();
        }
예제 #2
0
        public EfConfigurationProvider(Action <DbContextOptionsBuilder> optionsAction)
        {
            OptionsAction = optionsAction;

            var builder = new DbContextOptionsBuilder <SqlServerConfigurationDataContext>();

            OptionsAction(builder);

            using var dbContext = new SqlServerConfigurationDataContext(builder.Options);
            dbContext.Database.Migrate();
        }