private static SqliteConnection CreateDatabaseAndGetConnection() { var connection = new SqliteConnection("Data Source=:memory:"); connection.Open(); var options = new DbContextOptionsBuilder <LazyCMSMigrationsDbContext>() .UseSqlite(connection) .Options; using (var context = new LazyCMSMigrationsDbContext(options)) { context.GetService <IRelationalDatabaseCreator>().CreateTables(); } return(connection); }
public EntityFrameworkCoreLazyCMSDbSchemaMigrator(LazyCMSMigrationsDbContext dbContext) { _dbContext = dbContext; }