<?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 : DomainModelEntityManager.SaveChanges(IEnumberable entities) doesn&#039;t save properly</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : DomainModelEntityManager.SaveChanges(IEnumberable entities) doesn&#039;t save properly</description>
  <pubDate>Sun, 12 Apr 2026 04:40:00 -700</pubDate>
  <lastBuildDate>Thu, 09 Jul 2009 00:07:06 -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=1360</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>DomainModelEntityManager.SaveChanges(IEnumberable entities) doesn&#039;t save properly : &amp;#039;ToList()&amp;#034; is very useful...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4927#4927</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=454" rel="nofollow">monkeyking</a><br /><strong>Subject:</strong> 1360<br /><strong>Posted:</strong> 09-Jul-2009 at 12:07am<br /><br />'ToList()" is very useful to me when I apply anonymous type. because a list of anonymous type elements is a bit hard to make, I can use 'var query' to load a set of&nbsp; anonymous type elements from memory, but how can I convert that 'query' to a list to bind with? so if there is a 'ToList()' after query will be very useful in this case, but some time I can't find this method.]]>
   </description>
   <pubDate>Thu, 09 Jul 2009 00:07:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4927#4927</guid>
  </item> 
  <item>
   <title>DomainModelEntityManager.SaveChanges(IEnumberable entities) doesn&#039;t save properly :   Originally posted by monkeykingThanks...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4926#4926</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1360<br /><strong>Posted:</strong> 08-Jul-2009 at 8:40pm<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by monkeyking</strong></em><br /><br />Thanks GregD, it works :-)<br>how can I determine if the 'ToList()' method appear after the query?<br></td></tr></table><br><br>In this case, I used ToList() because I wanted the results in aList&lt;Customer&gt;, FindEntities&lt;Customer&gt;() returns anIEnumerable&lt;Customer&gt;, and the compiler can't implicitly convertthe latter to the former.<br><br>But often a call to ToList() is made primarily to force immediate execution of the query, when you need the results in the cache immediately.&nbsp; See this blog on LINQ and deferred execution:<br><br>&nbsp;&nbsp;&nbsp;&nbsp; http://blogs.msdn.com/charlie/archive/2007/12/09/deferred-execution.aspx<br><br><br><br>]]>
   </description>
   <pubDate>Wed, 08 Jul 2009 20:40:28 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4926#4926</guid>
  </item> 
  <item>
   <title>DomainModelEntityManager.SaveChanges(IEnumberable entities) doesn&#039;t save properly : Thanks GregD, it works :-)one...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4909#4909</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=454" rel="nofollow">monkeyking</a><br /><strong>Subject:</strong> 1360<br /><strong>Posted:</strong> 06-Jul-2009 at 4:44pm<br /><br />Thanks GregD, it works :-)<br><br>one more question. i find some time i have 'ToList()' method after a query, but some time there is not, in my case, I don't have that 'ToList()', so I just pass the whole query as the parameter of SaveChanges(), so I how can I determine if the 'ToList()' method appear after the query?]]>
   </description>
   <pubDate>Mon, 06 Jul 2009 16:44:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4909#4909</guid>
  </item> 
  <item>
   <title>DomainModelEntityManager.SaveChanges(IEnumberable entities) doesn&#039;t save properly : The overload of SaveChanges()...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4906#4906</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1360<br /><strong>Posted:</strong> 06-Jul-2009 at 1:48pm<br /><br />The overload of SaveChanges() that takes an IEnumerable works fine with deleted Entities. On the other hand, DevForce automatically removes entities from BindableLists when those entities get deleted. So probably what's happening is that you're passing SaveChanges() a list that already has the deleted entities removed.<br><br>So, you need to pass it a list that includes the deleted entities. You can use EntityManager.FindEntities&lt;T&gt;(EntityState.Deleted) to get a list of references to deleted entities of type T; e.g., <br><br>&nbsp;&nbsp;&nbsp; List&lt;Customer&gt; deletedCustomers = EntityManager.FindEntities&lt;Customer&gt;(EntityState.Deleted) .ToList();<br><br>then add those entities to the list you pass to SaveChanges().<br>]]>
   </description>
   <pubDate>Mon, 06 Jul 2009 13:48:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4906#4906</guid>
  </item> 
  <item>
   <title>DomainModelEntityManager.SaveChanges(IEnumberable entities) doesn&#039;t save properly : DomainModelEntityManager.SaveChanges(IEnumberable...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4898#4898</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=454" rel="nofollow">monkeyking</a><br /><strong>Subject:</strong> 1360<br /><strong>Posted:</strong> 05-Jul-2009 at 6:10pm<br /><br />DomainModelEntityManager.SaveChanges(IEnumberable entities) only beable to save the added entities and modified entities, but it can'tsave the deleted entities, but DomainModelEntityManager.SaveChanges()be able to save properly. But we do needDomainModelEntityManager.SaveChanges(IEnumberable entities), because itcan save a specific GUI's data.<br><br>this is the delete method i'm using, it's able to delete the entities in cache<br><img src="uploads/454/deleteprocess.jpg" height="129" width="660" border="0" /><br><br>this is the save method, it works for add and modify, but doesn't work for delete.<br><img src="uploads/454/savethis.png" height="72" width="605" border="0" /><br><br>&nbsp;the SaveIndividual might be a bit confusing you i think, acutually it just uses the SaveChanges(IEnumberable entities) method.<br><br><br><br><br><br><br><br>]]>
   </description>
   <pubDate>Sun, 05 Jul 2009 18:10:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1360&amp;PID=4898#4898</guid>
  </item> 
 </channel>
</rss>