<?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 : ImportEntities and n-n relations</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : ImportEntities and n-n relations</description>
  <pubDate>Wed, 13 May 2026 17:03:34 -700</pubDate>
  <lastBuildDate>Tue, 01 Nov 2011 16:51:57 -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=3008</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>ImportEntities and n-n relations : I&amp;#039;ve actually just found...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11975#11975</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 3008<br /><strong>Posted:</strong> 01-Nov-2011 at 4:51pm<br /><br />I've actually just found a solution for the main issue. Now I'm just left with the same issue that Walid has. I'll post what I've had to do in my other thread.<br>]]>
   </description>
   <pubDate>Tue, 01 Nov 2011 16:51:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11975#11975</guid>
  </item> 
  <item>
   <title>ImportEntities and n-n relations : Will do.I&amp;#039;m not sure if they&amp;#039;re...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11974#11974</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3008<br /><strong>Posted:</strong> 01-Nov-2011 at 4:35pm<br /><br />Will do.<div><br></div><div>I'm not sure if they're actually the same issue though. I have to look into it again since it's been a while.</div>]]>
   </description>
   <pubDate>Tue, 01 Nov 2011 16:35:37 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11974#11974</guid>
  </item> 
  <item>
   <title>ImportEntities and n-n relations : This was one of the issues I was...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11965#11965</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 3008<br /><strong>Posted:</strong> 31-Oct-2011 at 11:52am<br /><br />This was one of the issues I was having a few months back. <br><br>http://www.ideablade.com/forum/forum_posts.asp?TID=2596&amp;KW=smi%2Dmark&amp;title=possible-bug-import-entities<br><br>Glad it's getting fixed. Can you update us when you know if it's going to be in the next version?<br>]]>
   </description>
   <pubDate>Mon, 31 Oct 2011 11:52:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11965#11965</guid>
  </item> 
  <item>
   <title>ImportEntities and n-n relations :  Hi Walid;Sorry for the delayed...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11964#11964</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3008<br /><strong>Posted:</strong> 31-Oct-2011 at 11:46am<br /><br />Hi Walid;<div><br></div><div>Sorry for the delayed reply. Yes, this is a bug and I have a filed a bug report for it.&nbsp;It should (but no guarantee) be fixed in the next release.</div><span style="font-size:10px"><br /><br />Edited by DenisK - 31-Oct-2011 at 11:48am</span>]]>
   </description>
   <pubDate>Mon, 31 Oct 2011 11:46:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11964#11964</guid>
  </item> 
  <item>
   <title>ImportEntities and n-n relations :   Any news Denis ? </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11949#11949</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=998" rel="nofollow">Walid</a><br /><strong>Subject:</strong> 3008<br /><strong>Posted:</strong> 27-Oct-2011 at 1:15am<br /><br />Any news Denis ?]]>
   </description>
   <pubDate>Thu, 27 Oct 2011 01:15:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11949#11949</guid>
  </item> 
  <item>
   <title>ImportEntities and n-n relations :   Ok, thank you Denis. </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11885#11885</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=998" rel="nofollow">Walid</a><br /><strong>Subject:</strong> 3008<br /><strong>Posted:</strong> 19-Oct-2011 at 11:48pm<br /><br />Ok, thank you Denis.]]>
   </description>
   <pubDate>Wed, 19 Oct 2011 23:48:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11885#11885</guid>
  </item> 
  <item>
   <title>ImportEntities and n-n relations :  Hi Walid;I was able to reproduce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11875#11875</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3008<br /><strong>Posted:</strong> 19-Oct-2011 at 6:54pm<br /><br />Hi Walid;<div><br></div><div>I was able to reproduce your issue but let me clarify this first with a senior engineer and get back to you.</div><span style="font-size:10px"><br /><br />Edited by DenisK - 19-Oct-2011 at 7:05pm</span>]]>
   </description>
   <pubDate>Wed, 19 Oct 2011 18:54:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11875#11875</guid>
  </item> 
  <item>
   <title>ImportEntities and n-n relations :   I&amp;#039;m trying to implement...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11813#11813</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=998" rel="nofollow">Walid</a><br /><strong>Subject:</strong> 3008<br /><strong>Posted:</strong> 13-Oct-2011 at 2:44am<br /><br />I'm trying to implement a sandbox editor for an entity having an n-n relation and have some troubles when I import the modified (and committed) entity back to the original manager.<div> </div><div>For example, lets say we have <em>Users</em> (<em>Administrator</em>, <em>User1</em>, <em>User2</em>) and <em>Roles</em> (<em>Admins</em>, <em>Readers</em>,...). </div><div> </div><div>A User has n-roles (<em>User.Roles</em>) ex <em>User1.Roles</em> = {<em>Admins, Readers</em>}, the entity relation is called <em>UsersInRoles</em></div><div> </div><div>After editing the existing user and removing some roles (importing it in a new EM then <em>User1.Roles.Remove(Admins)</em>) , re-importing it back (with a correct <em>EntityGraph</em> collection and <em>OverrideChanges</em> merge strategy)  to the original EntityManager, leaves the <em>User1.Roles</em> collection untouched, the removed role <em>Admins</em> still remains in the <em>Roles</em> collection. If I refresh the original EM reloaded User has the correct roles.</div><div> </div><div>Is it a limitation of DevForce or a bug ?</div><div> </div><div>Sample Code :</div><div><span style="color: blue;"><span style="color: blue;">...</span></span></div><div><pre style=": white; color: black; font-family: C&#111;nsolas;"><span style="color: blue;">public</span> <span style="color: rgb43, 145, 175;">User</span> ImportUser(<span style="color: rgb43, 145, 175;"><span style="color: rgb43, 145, 175;">User</span><font color="#000000"> user, <span style="color: rgb43, 145, 175;"><span style="color: rgb43, 145, 175;">EntityManager </span></span>manager</font></span>){</pre><pre style=": white; color: black; font-family: C&#111;nsolas;">...</pre></div><div><span style="color: blue;"></span><span style="color: blue;">var</span> spans = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">List</span>&lt;<span style="color: rgb43, 145, 175;">EntitySpan</span>&gt;() {<span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">EntitySpan</span>(<span style="color: blue;">typeof</span>(<span style="color: rgb43, 145, 175;">User</span>), <span style="color: rgb43, 145, 175;">EntityRelations</span>.UsersInRoles)};</div><div> </div><div>manager.ImportEntities(user.EntityAspect.EntityManager.FindEntityGraph(<span style="color: blue;">new</span> <span style="color: blue;">object</span>&#091;&#093; {user}, spans, <span style="color: rgb43, 145, 175;">EntityState</span>.AllButDetached));</div><div> </div><div><pre style=": white; color: black; font-family: C&#111;nsolas;"><span style="color: blue;">return</span> = (<span style="color: rgb43, 145, 175;">User</span>)manager.FindEntity(user.EntityAspect.EntityKey);</pre><pre style=": white; color: black; font-family: C&#111;nsolas;">}</pre></div><div> </div><div> </div><div>...</div><div> </div><div><span style="color: blue;">var</span> sandboxEM = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;"></span><span style="color: rgb43, 145, 175;">MyEntityManager</span>();</div><div><div><span style="color: blue;">var</span> sandboxUser = ImportUser(editingUser, sandboxEM);</div><div>...</div><div>sandboxUser.Roles.Remove(AdminRole);</div><div>...</div><div>sandboxEM.SaveChangesAsync(...);</div><div>...</div><div> ImportUser(sandboxUser, originalEM);</div><div>...</div><div> </div><div>editingUser.Roles contains AdminRole !!!!</div><div> </div></div><div> </div><div> </div><div>Thanks,</div>]]>
   </description>
   <pubDate>Thu, 13 Oct 2011 02:44:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3008&amp;PID=11813#11813</guid>
  </item> 
 </channel>
</rss>