コード例 #1
0
 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());
     }
 }
コード例 #2
0
        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());
            }
        }