public static bool MigrateIfNeeded(MongoStorageOptions storageOptions, IMongoDatabase database) { using (var migrationLock = new MigrationLock(database, storageOptions.Prefix, storageOptions.MigrationLockTimeout)) { var migrationManager = new MongoMigrationManager(storageOptions, database); migrationLock.AcquireMigrationAccess(); return(migrationManager.Migrate()); } }
public static bool MigrateIfNeeded(MongoStorageOptions storageOptions, IMongoDatabase database) { var migrateLockCollectionName = storageOptions.Prefix + ".migrationLock"; using (new MigrationLock(database, migrateLockCollectionName, storageOptions.MigrationLockTimeout)) { var migrationManager = new MongoMigrationManager(storageOptions, database); return(migrationManager.Migrate()); } }