Kodumun ilk geçişi gereken dört farklı veritabanına sahibim. Ben İdeal bir komut dosyası gibi bir şey yukarıda koymak mümkün olmak ister ve bir aday olacağını ancak geçişi gerçekleştirmek için Paket Yöneticisi konsolunda yukarıdakilerin her birini çalıştırmak için gereken Şu andaTek seferde çoklu veritabanı geçişi
-- Enabling migrations
Enable-Migrations -StartUpProjectName SampleProject -MigrationsDirectory Migrations\DB1Configuration -ContextTypeName DB1ConfigurationDbContext -ContextAssemblyName SampleProject -ConnectionStringName MyDbContext1
Enable-Migrations -StartUpProjectName SampleProject -MigrationsDirectory Migrations\DB2Configuration -ContextTypeName DB2ConfigurationDbContext -ContextAssemblyName SampleProject -ConnectionStringName MyDbContext2
Enable-Migrations -StartUpProjectName SampleProject -MigrationsDirectory Migrations\DB3Configuration -ContextTypeName DB3ConfigurationDbContext -ContextAssemblyName SampleProject -ConnectionStringName MyDbContext3
Enable-Migrations -StartUpProjectName SampleProject -MigrationsDirectory Migrations\DB4Configuration -ContextTypeName DB4ConfigurationDbContext -ContextAssemblyName SampleProject -ConnectionStringName MyDbContext4
-- Addning migrations
Add-Migration -StartUpProjectName SampleProject -Name InitialCreate -ConfigurationTypeName SampleProject.Migrations.DB2Configuration.Configuration -ConnectionStringName MyDbContext1
Add-Migration -StartUpProjectName SampleProject -Name InitialCreate -ConfigurationTypeName SampleProject.Migrations.DB1Configuration.Configuration -ConnectionStringName MyDbContext2
Add-Migration -StartUpProjectName SampleProject -Name InitialCreate -ConfigurationTypeName SampleProject.Migrations.DB3Configuration.Configuration -ConnectionStringName MyDbContext3
Add-Migration -StartUpProjectName SampleProject -Name InitialCreate -ConfigurationTypeName SampleProject.Migrations.DB4Configuration.Configuration -ConnectionStringName MyDbContext4
--Create the database
Update-Database -StartUpProjectName SampleProject -ConfigurationTypeName SampleProject.Migrations.DB2Configuration.Configuration -ConnectionStringName MyDbContext1
Update-Database -StartUpProjectName SampleProject -ConfigurationTypeName SampleProject.Migrations.DB1Configuration.Configuration -ConnectionStringName MyDbContext2
Update-Database -StartUpProjectName SampleProject -ConfigurationTypeName SampleProject.Migrations.DB3Configuration.Configuration -ConnectionStringName MyDbContext3
Update-Database -StartUpProjectName SampleProject -ConfigurationTypeName SampleProject.Migrations.DB4Configuration.Configuration -ConnectionStringName MyDbContext4
: Aşağıdaki düşünün yukarıdaki işlemi gerçekleştirmek için tek komut. Bu mümkün mü (birden fazla veritabanını tek seferde taşıyor)? Örnek verebilir misiniz lütfen?