@@ -6,19 +6,19 @@ namespace LinkDotNet.Blog.UpgradeAssistant;
66
77public sealed class MigrationManager
88{
9- private readonly List < IMigration > _migrations ;
10- private readonly string _currentVersion ;
9+ private readonly List < IMigration > migrations ;
10+ private readonly string currentVersion ;
1111
1212 public MigrationManager ( IEnumerable < IMigration > migrations )
1313 {
14- _migrations = migrations . ToList ( ) ;
15- _currentVersion = DetermineCurrentVersionFromMigrations ( ) ;
14+ this . migrations = migrations . ToList ( ) ;
15+ currentVersion = DetermineCurrentVersionFromMigrations ( ) ;
1616 }
1717
1818 private string DetermineCurrentVersionFromMigrations ( )
1919 {
20- return _migrations . Count > 0
21- ? _migrations . Max ( m => m . ToVersion ) ?? "11.0"
20+ return migrations . Count > 0
21+ ? migrations . Max ( m => m . ToVersion ) ?? "11.0"
2222 : "11.0" ;
2323 }
2424
@@ -53,7 +53,7 @@ public async Task<bool> MigrateFileAsync(string filePath, bool dryRun, string ba
5353 }
5454
5555 var currentVersion = GetVersion ( document ) ;
56- ConsoleOutput . WriteInfo ( $ "Current version: { currentVersion ?? $ "Not set (pre-{ _currentVersion } )"} ") ;
56+ ConsoleOutput . WriteInfo ( $ "Current version: { currentVersion ?? $ "Not set (pre-{ this . currentVersion } )"} ") ;
5757
5858 var applicableMigrations = GetApplicableMigrations ( currentVersion ) ;
5959
@@ -102,7 +102,7 @@ public async Task<bool> MigrateFileAsync(string filePath, bool dryRun, string ba
102102
103103 if ( hasAnyChanges )
104104 {
105- modifiedContent = SetVersion ( modifiedContent , _currentVersion ) ;
105+ modifiedContent = SetVersion ( modifiedContent , this . currentVersion ) ;
106106
107107 if ( ! dryRun )
108108 {
@@ -145,7 +145,7 @@ private List<IMigration> GetApplicableMigrations(string? currentVersion)
145145 while ( foundMigration )
146146 {
147147 foundMigration = false ;
148- foreach ( var migration in _migrations )
148+ foreach ( var migration in migrations )
149149 {
150150 if ( migration . FromVersion == currentMigrationVersion )
151151 {
0 commit comments