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