Enable migration in a class library project

How to enable migration in a class library project?

I am creating a project using Code First EF5 . I want to separate data and mvc web project by adding class library project.

Migration is now included in the mvc web project. I also have to remove this.

Any ideas?

+7
source share
1 answer

You must do this using the "Package Manager Console" (View> Other Windows> Package Manager Console).

Make sure that the class library project for which you want to enable migration is installed in the default project drop-down list, make sure you have a link to the Entity Framework DLL in the project, and then run enable-migrations .

To run update-database commands, etc., you need an app.config file that contains a connection string for each of your data contexts.

+9
source

All Articles