private object _MigrateContent(object content, int contentVersion, int targetVersion, IContentMigrator migrator) { MigrationPath migrationPath = _BuildMigrationPath(migrator, contentVersion, targetVersion); foreach (IMigrationSegment migrationSegment in migrationPath) { try { content = migrator.MigrateContent(content, migrationSegment.FromVersion, migrationSegment.ToVersion); } catch (Exception ex) { throw new Exception("Error when migrating from version " + contentVersion + " to version " + targetVersion, ex); } } return(content); }
private object _MigrateContent(object content, int contentVersion, int targetVersion, IContentMigrator migrator) { MigrationPath migrationPath = _BuildMigrationPath(migrator, contentVersion, targetVersion); foreach (IMigrationSegment migrationSegment in migrationPath) { try { content = migrator.MigrateContent(content, migrationSegment.FromVersion, migrationSegment.ToVersion); } catch (Exception ex) { throw new Exception( string.Format("Error when migrating from version {0} to version {1}", contentVersion, targetVersion), ex); } } return content; }