private static SqliteConnection CreateDatabaseAndGetConnection()
        {
            var connection = new SqliteConnection("Data Source=:memory:");

            connection.Open();

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

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

            return(connection);
        }
コード例 #2
0
 public EntityFrameworkCoreWenitorDbSchemaMigrator(WenitorMigrationsDbContext dbContext)
 {
     _dbContext = dbContext;
 }