实体框架4.1分离方案级联更新 [英] Entity Framework 4.1 detach scenario cascading update

查看:83
本文介绍了实体框架4.1分离方案级联更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用EF CTP4,并且没有任何简单的方法可以在分离的情况下执行级联udate.示例:我有一些元素树,这些元素从服务器发送到客户端(它是分离的).客户端修改此树(属性和关系),并将其发送回服务器.现在,我要附加此树并将其保存起来,而不会太忙.

I have worked with EF CTP4 and there wasnt any easy way how to perform cascading udate in detached scenario. Example: I have tree of elements which gets send from server to client (it gets detached). Client modifies this tree (properties and relations) and sends it back to server. Now I want to attach this tree and save it without much hustle.

我的问题在EF CTP5中是可能的,如果没有计划的话?我想知道EF是否会在可能的情况下达到NHibernate的成熟度(我可以在其中配置是否要级联delete/update-save/none/etc).

My question is this posible in EF CTP5 and if not is it planned? Im wondering if EF will reach maturity of NHibernate where this is possible (where I can configure if I want cascading delete/update-save/none/etc).

推荐答案

不,这仍然是不可能的,据我所知,这是没有计划的.使用分离的实体图时,您有责任告诉EF发生了什么变化. EF 4.1只是EF 4的包装,因此这个答案对DbContext API也有效.

No it is still not possible and as I know it is not planned. When working with detached entity graphs you are responsible for telling EF what has changed. EF 4.1 is just a wrapper for EF 4 so this answer is valid for DbContext API as well.

这篇关于实体框架4.1分离方案级联更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆