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