Reputation: 531
I've a scenario where the project structure as following
Now the problem is If I keep My DbContext in DomainModel which I'm supposed to keep, I cann't enable Db Migrations.
-- The only solution I've come across is to give the reference of 'DomainModels' to 'MVC projects' using Enable-Migration MigrationName SomeAdditionalParameter here
Upvotes: 0
Views: 65
Reputation: 2933
Why is this a problem? I have a Data project which contains the models and DbContext. My web and business projects reference this. When I run the Add-Migration step, I just select the Data project in the project dropdown and it uses the connection string in the web.config in the web project. It works well and I have no problems.
Upvotes: 1