What causes POCO proxy entities to only sometimes be created in Entity Framework 4

偶尔善良 提交于 2019-12-06 16:44:13

Solved it (im getting in the habit of almost giving up, posting here and then solving it)

Anyway, when I was adding a new Question i was using something like var q = new Question() this was then being stored as a non-proxy. In the end i found out by creating a new Question on the ObjectContext like so var q = ObjectContext.CreateObject<Question>(); causes it to be a proxy and works just fine and dandy.

Hope this helps someone,
Cheers,
Kohan.

A helpful source : http://blogs.msdn.com/b/adonet/archive/2009/06/10/poco-in-the-entity-framework-part-3-change-tracking-with-poco.aspx (read the comments)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!