<?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 : multiple entity manager (second attempt)</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : multiple entity manager (second attempt)</description>
  <pubDate>Sat, 11 Apr 2026 23:06:28 -700</pubDate>
  <lastBuildDate>Mon, 01 Nov 2010 15:19:15 -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=2278</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>multiple entity manager (second attempt) : The collection is an entity graph....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2278&amp;PID=8998#8998</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=870" rel="nofollow">hueha</a><br /><strong>Subject:</strong> 2278<br /><strong>Posted:</strong> 01-Nov-2010 at 3:19pm<br /><br />The collection is an entity graph. &nbsp;That entity key thing should work just fine, thanks.]]>
   </description>
   <pubDate>Mon, 01 Nov 2010 15:19:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2278&amp;PID=8998#8998</guid>
  </item> 
  <item>
   <title>multiple entity manager (second attempt) : On step 4 you have a collectionwith...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2278&amp;PID=8997#8997</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> 2278<br /><strong>Posted:</strong> 01-Nov-2010 at 3:15pm<br /><br /><P>On step 4 you have a collection&nbsp;with the imported entity (which, I assume, is the only entity in the collection): </P><DIV>&nbsp;</DIV><DIV>_Mgr.ImportEntities(<strong>this.FindEntities(EntityState.Added | EntityState.Deleted | EntityState.Modified)</strong>, MergeStrategy.OverwriteChanges);</DIV><DIV>&nbsp;</DIV><DIV>So you can ref the entity&nbsp;from mgr2 and find it&nbsp;in _mgr&nbsp;by Key with FindEntity:</DIV><DIV>&nbsp;&nbsp; </DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>em2.FindEntity(myEntityInMgr2.EntityAspect.EntityKey);</FONT></FONT></DIV>]]>
   </description>
   <pubDate>Mon, 01 Nov 2010 15:15:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2278&amp;PID=8997#8997</guid>
  </item> 
  <item>
   <title>multiple entity manager (second attempt) : I&amp;#039;ve finally got the motivation...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2278&amp;PID=8991#8991</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=870" rel="nofollow">hueha</a><br /><strong>Subject:</strong> 2278<br /><strong>Posted:</strong> 30-Oct-2010 at 8:32am<br /><br />I've finally got the motivation to have another crack at using multiple entity managers in my application. &nbsp;I've managed to get it to work for editing an entity but having problems with adding a new entity.<div><br></div><div>I have a grid displaying a list of entities (lets say orders for an employee). &nbsp;When I go to add a new entity these are the steps I'm going through. &nbsp;I have an issue at step 5</div><div><br></div><div>1) Create a new entity</div><div>&nbsp;<span ="Apple-tab-span" style="white-space:pre">	</span>_mgr.CreateEntity&lt;Order&gt;();</div><div>2) Create the new entity manager and copy this new item over</div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var mgr2 = new MyEntities();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mgr2.LinkForAuthentication(this);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mgr2.EntityChanged += (s, args) =&gt; { if (args.Action == EntityAction.Delete) { _mgr.RemoveEntity(args.Entity); } };</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mgr2.ImportEntities(new Entity&#091;&#093; { root }, MergeStrategy.OverwriteChanges);</div></div><div>3) Make changes to this entity and save it</div><div><br></div><div>4) I copy the new &nbsp;entity back into the main entity manager</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>_Mgr.ImportEntities(this.FindEntities(EntityState.Added | EntityState.Deleted | EntityState.Modified), MergeStrategy.OverwriteChanges);</div><div><br></div><div>5) The problem I have is at this point I would normally add to the new Entity to RelatedEntityList to make the order appear for that employee. &nbsp;BUT how do I get a reference to the newly imported entity?</div>]]>
   </description>
   <pubDate>Sat, 30 Oct 2010 08:32:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2278&amp;PID=8991#8991</guid>
  </item> 
 </channel>
</rss>