Reattaching an entity graph and detecting collection changes

后端 未结 2 1653
醉酒成梦
醉酒成梦 2021-01-13 08:16

I\'m using entity framework code first and exposing the northwind database through a WCF REST HTTP interface.

I\'ve not exposed the OrderDetails table (order items)

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-13 08:50

    I've recently been allowed to open source some work I did for my employer a while ago (with some changes of course). I actually wrote an extension method to solve this problem, you can get it at http://refactorthis.wordpress.com/2012/12/11/introducing-graphdiff-for-entity-framework-code-first-allowing-automated-updates-of-a-graph-of-detached-entities/

    Hope it helps!

提交回复
热议问题