예제 #1
0
        private static SqliteConnection CreateDatabaseAndGetConnection()
        {
            var connection = new SqliteConnection("Data Source=:memory:");

            connection.Open();

            var options = new DbContextOptionsBuilder <BackendMigrationsDbContext>()
                          .UseSqlite(connection)
                          .Options;

            using (var context = new BackendMigrationsDbContext(options))
            {
                context.GetService <IRelationalDatabaseCreator>().CreateTables();
            }

            return(connection);
        }
예제 #2
0
 public EntityFrameworkCoreBackendDbSchemaMigrator(BackendMigrationsDbContext dbContext)
 {
     _dbContext = dbContext;
 }