<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Saving many-to-many relationship</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Saving many-to-many relationship</description>
  <pubDate>Sun, 12 Apr 2026 21:18:03 -700</pubDate>
  <lastBuildDate>Fri, 22 Jul 2011 08:39:42 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2841</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Saving many-to-many relationship : Hi CJBriers,This is a bug that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2841&amp;PID=11267#11267</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2841<br /><strong>Posted:</strong> 22-Jul-2011 at 8:39am<br /><br />Hi CJBriers,<br><br>This is a bug that has been fixed.<br><br>DevForce 6.1.2 will have the fix and will be available early in August.<br><br>Silvio.<br>]]>
   </description>
   <pubDate>Fri, 22 Jul 2011 08:39:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2841&amp;PID=11267#11267</guid>
  </item> 
  <item>
   <title>Saving many-to-many relationship :  Let&amp;#039;s say we have a many-to-many...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2841&amp;PID=11266#11266</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1212" rel="nofollow">CJBriers</a><br /><strong>Subject:</strong> 2841<br /><strong>Posted:</strong> 22-Jul-2011 at 7:38am<br /><br /><div>Let's say we have a many-to-many relationship between Person and Pet entities (with no payload). &nbsp;When adding an <b>existing</b> Pet entity to a Person and saving the Person entity:</div><div><span ="apple-style-span"="" style="color: rgb0, 102, 255; "><br></span></div><div><span ="apple-style-span"="" style="color: rgb0, 102, 255; ">aPerson.Pets.Add(aPet);</span></div><div><span ="apple-style-span"="" style="color: rgb0, 102, 255; ">EM.Instance.SaveChangesAsync(new &#091;&#093; {aPerson}); //we're using singleton pattern</span></div><div><br></div><div>This causes a duplicate (same data, different ID) aPet entity to be saved to the DB. &nbsp;</div><div><br></div><div>However, if I do this:</div><div><br></div><div><div><span ="apple-style-span"="" style="color: rgb0, 102, 255; ">aPerson.Pets.Add(aPet);</span></div><div><span ="apple-style-span"="" style="color: rgb0, 102, 255; ">EM.Instance.SaveChangesAsync();&nbsp;</span></div></div><div><span ="apple-style-span"="" style="color: rgb0, 102, 255; "><br></span></div><div>No duplicate entry is saved to the DB. &nbsp;Due to the nature of our application, I really prefer saving only the aPerson entity and not the Pet entities. Any way to do this?</div><span style="font-size:10px"><br /><br />Edited by CJBriers - 03-Aug-2011 at 6:48am</span>]]>
   </description>
   <pubDate>Fri, 22 Jul 2011 07:38:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2841&amp;PID=11266#11266</guid>
  </item> 
 </channel>
</rss>