Unable to generate an explicit migration - Entity Framework 6.1.3 with multiple Contexts / Configurations

asp.net asp.net-mvc entity-framework entity-framework-6

Accepted Answer

Here is the answer I discovered for this: How can I allow EF migrations to different databases in numerous contexts?

The response by "bart s" contained the information I was missing. The Enable-Migrations -MigrationsDirectory argument can be used to create the configuration files' own namespace, which is required. The following is what it means in my scenario (I've added some extra factors here after trying various things):

Enable-Migrations -MigrationsDirectory "Migrations\InsideAdmin" -ContextTypeName InsideIIMAK.Domain.Concrete.InsideAdminContext -StartUpProjectName InsideAdmin

Enable-Migrations -MigrationsDirectory "Migrations\PartFinder" -ContextTypeName InsideIIMAK.Domain.Concrete.PartFinderContext -StartUpProjectName InsideAdmin

Add-Migration "InitialMigrationForPartFinder" -ConfigurationTypeName InsideIIMAK.Domain.Migrations.PartFinder.PartFinderConfiguration -StartUpProjectName InsideAdmin -ConnectionStringName PartFinderContext

update-database -ConfigurationTypeName InsideIIMAK.Domain.Migrations.PartFinder.PartFinderConfiguration -StartUpProjectName InsideAdmin -ConnectionStringName PartFinderContext

Add-Migration "ServiceRequest" -ConfigurationTypeName InsideIIMAK.Domain.Migrations.InsideAdmin.InsideAdminConfiguration -StartUpProjectName InsideAdmin -ConnectionStringName InsideAdminContext

update-database -ConfigurationTypeName InsideIIMAK.Domain.Migrations.InsideAdmin.InsideAdminConfiguration -StartUpProjectName InsideAdmin -ConnectionStringName InsideAdminContext
2
5/23/2017 11:53:34 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow