Migrations in code first for a solution with multiple projects and one Database

448 Views Asked by At

I'm working with a MVC4 Project (Code first). This solution contains two projects, and projects share a unique database. I have done a class library with clases POCO and the two projects reads of these class libraries. There are one dbcontext in each Project, but not all clases are included in the two Project. For example, there are clases of simplemembership and one of projects is running with active directory permissions and there are some clases that only are used in one project. I want to do Code first migrations, but I don´t know how Can I do it, because allways detects pending changes and one Project apply changes on database that are not compatible with the other project.. Is it a solution to copy the same content of DBContext for two projects and initialize allways all the library classes? or exists a better solution? Thanks.

0

There are 0 best solutions below