为什么我的一个实体突然使用快照而不是更改跟踪?

发布于 2024-11-01 08:20:46 字数 436 浏览 0 评论 0原文

我有一个 Entity Framework 4 项目,其中包含许多 POCO 实体(50+),这些实体是使用模板从 edmx 文件自动生成的。它们都默认使用代理和更改跟踪。一切都运行良好,直到我注意到我的一个实体突然不使用更改跟踪。当我仅在调试模式下查看该实体的 ObjectStateEntry 的实体包装器时,它显示它是一个 EntityWrapperWithoutRelationship,并且 ChangeTrackingState 设置为快照。我没有对这个特定实体做任何不同的事情,尽管它是一个大型实体,附加了许多导航项。它们都自动设置为 ICollection 属性,并且都是虚拟属性。该实体没有任何复杂的属性。它确实有一个计算字段,但我认为这与它没有任何关系。就像我说的,这个实体像其他实体一样工作正常,但我不明白为什么它不再工作了。我对整个应用程序和 edmx 文件进行了太多更改,无法知道它可能是什么。我确实可以深入了解造成这种情况的原因。

I have an Entity Framework 4 project with many POCO Entities (50+) that are automatically generated from the edmx file using a template. They all default to use Proxies and Change Tracking. Everything has been working great, until I noticed that one of my Entities all of a sudden is not using Change Tracking. When I look at the Entity Wrapper of the ObjectStateEntry in debug mode for this entity only, it shows that it is an EntityWrapperWithoutRelationship, and that the ChangeTrackingState is set to Snapshot. I have not done anything different to this specific entity, although it is a large entity with many navigation items attached to it. They are all automatically set as ICollection properties, and they all are virtual properties. This entity does not have any complex properties. It does have a computed field, but I don't think that has anything to do with it. Like I said, this entity was working fine like the other entities, but I cannot figure out why it no longer is. And I have made too many changes to the entire application and edmx file to know what it could be. I could really use some insight into what could be causing this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文