private static void MigrateToLatest(BackgroundTaskOptions taskOptions, DocumentDbOptions dbOptions) { var runner = new DocumentDbMigrationRunner(dbOptions); if (taskOptions.Store.CreateIfNotExists) { runner.CreateDatabaseIfNotExistsAsync().GetAwaiter().GetResult(); } if (taskOptions.Store.MigrateOnStartup) { runner.CreateCollectionIfNotExistsAsync().GetAwaiter().GetResult(); } }
private static void MigrateToLatest(RuntimeOptions runtimeOptions, DocumentDbOptions dbOptions) { var runner = new DocumentDbMigrationRunner(dbOptions); if (runtimeOptions.CreateIfNotExists) { runner.CreateDatabaseIfNotExistsAsync().GetAwaiter().GetResult(); } if (runtimeOptions.MigrateOnStartup) { runner.CreateCollectionIfNotExistsAsync().GetAwaiter().GetResult(); } }