EF 4.0 Hibernate 类似 saveupdate
我有 silverlight 应用程序,其中使用实体框架(PostgreSQL)和 WCF(不是 RIA)。 问题是:
在数据库中我有表组织和联系人表。组织有一组联系人。
EF 实体不是 wcf 使用的数据协定。我使用转换器从实体制作数据契约,反之亦然。所以我的问题是如何保存相关实体,如 hibernate saveupdate(cascade="save-update")?
I have silverlight application, where I use Entity Framework(PostgreSQL) and WCF(not RIA).
Here is the problem:
in database I have table organization and table of contacts. Organization has set of contacts.
EF entity is not a data contract used by wcf. I use convertor to make datacontract from entity and vice versa. So my question is how to save related entities like hibernate saveupdate(cascade="save-update")?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实体框架没有级联更新。您必须手动处理更改 =您必须手动决定修改哪些合同、添加哪些合同以及删除哪些合同。 MS 决定通过引入自我跟踪实体< /a> 但它们并不总是防弹并且是在 Silverlight 中使用起来比较困难,因为 STE 代码必须在客户端和客户端之间共享服务器。
Entity framework doesn't have cascade updates. You must manually handle changes = you must manually decide which contracts were modified, which were added and also wich were deleted. MS decided to solve this inconvinience by introducing Self tracking entities but they are not always bullet proof and are harder to use in Silverlight because STEs code must be shared among client and server.