开发者

VS2010 MVC and Entity Framework Model in Separate Project

开发者 https://www.devze.com 2023-01-01 15:35 出处:网络
I am trying to use an Entity Framework Model (in separate project) into an asp.net 4 MVC project (VS2010, C#)

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

精彩评论

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

关注公众号