File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain/Data Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,9 @@ public async Task MigrateAsync()
4747 var migratedDatabaseSchemas = new HashSet < string > ( ) ;
4848 foreach ( var tenant in tenants )
4949 {
50- if ( tenant . ConnectionStrings . Any ( ) )
50+ using ( _currentTenant . Change ( tenant . Id ) )
5151 {
52- using ( _currentTenant . Change ( tenant . Id ) )
52+ if ( tenant . ConnectionStrings . Any ( ) )
5353 {
5454 var tenantConnectionStrings = tenant . ConnectionStrings
5555 . Select ( x => x . Value )
@@ -62,9 +62,9 @@ public async Task MigrateAsync()
6262 migratedDatabaseSchemas . AddIfNotContains ( tenantConnectionStrings ) ;
6363 }
6464 }
65- }
6665
67- await SeedDataAsync ( tenant ) ;
66+ await SeedDataAsync ( tenant ) ;
67+ }
6868
6969 Logger . LogInformation ( $ "Successfully completed { tenant . Name } tenant database migrations.") ;
7070 }
You can’t perform that action at this time.
0 commit comments