Entity Framework 4.1 detach scenario cascading update

半城伤御伤魂 提交于 2019-12-11 07:00:57

问题


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.

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).


回答1:


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.



来源:https://stackoverflow.com/questions/6993066/entity-framework-4-1-detach-scenario-cascading-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!