문제

I am in the habit of separating my web project from the data access by creating a DAL project.

I have just recently been exploring migrations and code first.

I have only been able to deploy projects to my host when I have migrations in the same project as the Web site.

Is it possible to have separation of the data access layer and the web site projects and still use code first and data migrations and publishing from inside VS2013?

도움이 되었습니까?

해결책

I personally have a web site project (using windows authentication) which DAL in a stand-alone console project using code-first. Both projects have EF6 installed and they are running fine. The web site can be published to an IIS machine. I don't see any problems. Just make sure the console project be compiled as "Any CPU" so it could be integrated into the ASP.NET project or a run-time error will occur in my X64 environment.

You don't have to use console project to host the DAL (I did so because I need to do some import/export jobs); a plain class library project would do.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top