Merge Disconnected Object Graph

Topics: EF Runtime
Feb 10, 2013 at 10:09 PM
Edited Feb 11, 2013 at 1:57 AM
It is a fairly common when developing a web application to materialize a complex object graph from Entity Framework to render a CRUD view, and then on a subsequent HTTP request write that object graph back to the database.

Apparently, that scenario is not well supported in Entity Framework. For a detailed discussion, see

http://stackoverflow.com/q/3635071/141172 .

NHibernate does support this

http://www.ienablemuch.com/2011/01/nhibernate-saves-your-whole-object.html

There is at least one open source project that aims to solve this issue for EF:

http://stackoverflow.com/a/13820802/141172 .

I propose that Entity Framework should support a merge of disconnected object graph changes out of the box.
Developer
Feb 11, 2013 at 5:20 PM
Hi Eric,

This is a usability issue that we are aware of and is something we have been thinking about and plan to do more work on post-EF6. I have created this work item to track the issue: http://entityframework.codeplex.com/workitem/864 The work item also contains a link to the user voice item for this--I encourage you to vote for it if you have not done so already.

Thanks,
Arthur
Feb 11, 2013 at 7:09 PM
<div dir="ltr">Hi Arthur, <div><br> </div> <div>Thank you for your prompt reply.</div> <div><br> </div> <div>I would disagree that the impact is &quot;low&quot;, given that it affects many web development scenarios and the work-around for deep object graphs is quite ugly. The number of votes for both the question and Ladislav's answer at </div> <div><br> </div> <div><a href="http://stackoverflow.com/questions/3635071/update-relationships-when-saving-changes-of-ef4-poco-objects">http://stackoverflow.com/questions/3635071/update-relationships-when-saving-changes-of-ef4-poco-objects</a><br> </div> <div><br> </div> <div style="">are indicative that quite a few folks are facing this issue.</div> <div style=""><br> </div> <div style="">Regards,</div> <div style=""><br> Eric</div> </div> <div><br> <br> <div>On Mon, Feb 11, 2013 at 10:20 AM, ajcvickers <span dir="ltr">&lt;<a href="mailto:notifications@codeplex.com" target="_blank">notifications@codeplex.com</a>&gt;</span> wrote:<br> <blockquote style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex"> <div> <p>From: ajcvickers</p> <div>Hi Eric, <br> <br> This is a usability issue that we are aware of and is something we have been thinking about and plan to do more work on post-EF6. I have created this work item to track the issue: <a href="http://entityframework.codeplex.com/workitem/864" rel="nofollow" target="_blank"> http://entityframework.codeplex.com/workitem/864</a> The work item also contains a link to the user voice item for this--I encourage you to vote for it if you have not done so already. <br> <br> Thanks, <br> Arthur<br> </div> <div> <p>Read the <a href="http://entityframework.codeplex.com/discussions/432661#post999661" target="_blank"> full discussion online</a>.</p> <p>To add a post to this discussion, reply to this email (<a href="mailto:entityframework@discussions.codeplex.com?subject=[entityframework:432661]" target="_blank">entityframework@discussions.codeplex.com</a>)</p> <p>To start a new discussion for this project, email <a href="mailto:entityframework@discussions.codeplex.com" target="_blank"> entityframework@discussions.codeplex.com</a></p> <p>You are receiving this email because you subscribed to this discussion on CodePlex. You can <a href="https://entityframework.codeplex.com/discussions/432661/unsubscribe/" target="_blank"> unsubscribe</a> on CodePlex.com.</p> <p>Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com</p> </div> </div> </blockquote> </div> <br> </div>
Developer
Feb 11, 2013 at 7:38 PM
Hi Eric,

Low is the default initial impact. The item will get an appropriate impact set when the EF team triages new items, which usually happens once per week.

Thanks,
Arthur
Feb 11, 2013 at 8:41 PM
<div dir="ltr">Thank you Arthur.</div> <div><br> <br> <div>On Mon, Feb 11, 2013 at 12:38 PM, ajcvickers <span dir="ltr">&lt;<a href="mailto:notifications@codeplex.com" target="_blank">notifications@codeplex.com</a>&gt;</span> wrote:<br> <blockquote style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex"> <div> <p>From: ajcvickers</p> <div>Hi Eric, <br> <br> Low is the default initial impact. The item will get an appropriate impact set when the EF team triages new items, which usually happens once per week. <br> <br> Thanks, <br> Arthur<br> </div> <div> <div> <p>Read the <a href="http://entityframework.codeplex.com/discussions/432661#post999706" target="_blank"> full discussion online</a>.</p> <p>To add a post to this discussion, reply to this email (<a href="mailto:entityframework@discussions.codeplex.com?subject=[entityframework:432661]" target="_blank">entityframework@discussions.codeplex.com</a>)</p> <p>To start a new discussion for this project, email <a href="mailto:entityframework@discussions.codeplex.com" target="_blank"> entityframework@discussions.codeplex.com</a></p> <p>You are receiving this email because you subscribed to this discussion on CodePlex. You can <a href="https://entityframework.codeplex.com/discussions/432661/unsubscribe/" target="_blank"> unsubscribe</a> on CodePlex.com.</p> <p>Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com</p> </div> </div> </div> </blockquote> </div> <br> </div>