public void MatureContent(int fileVersion, string originalFilePath) { List<IFileOperationResult> migrationResults = new List<IFileOperationResult>(); int policyVersion = _filePolicy.GetVersion(); MigrationDriver migrationDriver = new MigrationDriver(fileVersion, policyVersion, _migrator); if(migrationDriver.MigrationNeeded) { if(migrationDriver.MigrationPathAvailable) { _BackupFile(originalFilePath, fileVersion); migrationResults.AddRange(migrationDriver.Migrate()); } else { migrationResults.Add(new FileOperationResult(false, "The file requires a migration, but a proper migration path is not available.")); } } MigrationResults = migrationResults; }
public void MatureContent(int fileVersion, string originalFilePath) { List <IFileOperationResult> migrationResults = new List <IFileOperationResult>(); int policyVersion = _filePolicy.GetVersion(); MigrationDriver migrationDriver = new MigrationDriver(fileVersion, policyVersion, _migrator); if (migrationDriver.MigrationNeeded) { if (migrationDriver.MigrationPathAvailable) { _BackupFile(originalFilePath, fileVersion); migrationResults.AddRange(migrationDriver.Migrate()); } else { migrationResults.Add(new FileOperationResult(false, "The file requires a migration, but a proper migration path is not available.")); } } MigrationResults = migrationResults; }