开发者

VS2010 MVC and Entity Framework Model in Separate Project

I am trying to use an Entity Framework Model (in separate project) into an asp.net 4 MVC project (VS2010, C#) If I create the EF inside the MVC project I have no problems. I think I am missing some step.

things done: 1. added reference to the EF class project 2. added connection string in MVC web.config 3. added reference to System.Data.Entity in both web.config and project references

Now i can开发者_开发技巧 use the model only if I copy the .edmx file to the Models folder, but in this way the EF project is not external anymore.

What am I missing? Thank you in advance.


Have you set the entity model to create public classes? (Set in the models properties, and each of its entities.)


You seem to done all necessary steps already. Try to remove the reference and add it again and rebuild it.

I had same problem but after rebuild the solution (1 MVC project and 1 data access layer project), everything works fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜