EF 4.0 model caching the data, and does not detect the modified data

后端 未结 2 446
慢半拍i
慢半拍i 2020-12-10 17:54

I am developing ASP.NET application and I have problem with the EF 4.0 model.

The EF model detects the newly added and deleted data, but not the modified data from t

2条回答
  •  执念已碎
    2020-12-10 18:09

    This is correct behavior based on essential concepts of ORM. It also works same for Linq to SQL. The reason for this is design pattern called IdentityMap which ensures that each entity identified by its key is created only once for object context. So your first query creates entites but your subsequent queries don't recreate them - they already exists. The full description of this problem is described in this very nice article.

提交回复
热议问题