EDIT: This happen only on larger scale projects with repositories. Is there anybody using EF4 with CodeFirst approach and using repositories? Please advise me.
Hi. I
The problem in this instance is that change tracking proxies are being generated because all the properties on your class are marked as virtual. By convention this triggers Change Tracking Proxy generation.
So you can either remove virtual keyword from one or more properties or simply tell the context not to generate change tracking proxies as per Working with POCO Entities.
var ctx = new MyDbContext();
ctx.Configuration.ProxyCreationEnabled = false;