<?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 Cache State of an Entity Group</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Saving Cache State of an Entity Group</description>
  <pubDate>Sun, 12 Apr 2026 08:51:57 -700</pubDate>
  <lastBuildDate>Tue, 01 Nov 2011 12:07:48 -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=3049</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 Cache State of an Entity Group :   Hi Stephen,This is indeed...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3049&amp;PID=11972#11972</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> 3049<br /><strong>Posted:</strong> 01-Nov-2011 at 12:07pm<br /><br />Hi Stephen,<div>&nbsp;</div><div>This is indeed an undocumented breaking change. I'll update the release notes.</div><div>&nbsp;</div><div>EntityGroup now implements an IEnumerable&lt;EntityAspect&gt; instead of an IEnumerable&lt;Object&gt; (where the Object is an&nbsp;entity).</div><div>&nbsp;</div><div>You're workaround is the correct approach.</div><div>&nbsp;</div><div>Regards,</div><div>&nbsp;&nbsp; Silvio.</div>]]>
   </description>
   <pubDate>Tue, 01 Nov 2011 12:07:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3049&amp;PID=11972#11972</guid>
  </item> 
  <item>
   <title>Saving Cache State of an Entity Group : I just upgraded to 6.1.3.1 and...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3049&amp;PID=11923#11923</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=613" rel="nofollow">stephenmcd1</a><br /><strong>Subject:</strong> 3049<br /><strong>Posted:</strong> 21-Oct-2011 at 5:03pm<br /><br />I just upgraded to 6.1.3.1 and ran into a small problem. &nbsp;Our app caches a lot of data to Isolated Storage and we've broken up the cache saves so we write to a&nbsp;separate&nbsp;file for each Entity Group. &nbsp;Previously, we could do code like this without a problem:<div><table width="99%"><tr><td><pre class="BBcode">//Find a random entity group that has at least one entity in it (in our real&nbsp;</div><div>// &nbsp; app, this logic is different but this is an easy way to reproduce the problem).</div><div>var aNonEmptyGroup = _entityManager.GetEntityGroups().First(g =&gt; g.Count() &gt; 0);</div><div><br></div><div>using (var dummyStream = new MemoryStream())</div><div>{</div><div>&nbsp; &nbsp; //Save the entities in the given group out to the stream</div><div>&nbsp; &nbsp; _entityManager.CacheStateManager.SaveCacheState(aNonEmptyGroup, dummyStream);</div><div>}</pre></td></tr></table></div><div>However under 6.1.3.1, this code throws an ArgumentException with a message of "already an EntityAspect". &nbsp;It seems some logic is trying to wrap an Entity Aspect in another Entity Aspect and it gets confused. &nbsp;I found an easy workaround but I'm not entirely sure it's the best way. &nbsp;The new code does this:</div><div><table width="99%"><tr><td><pre class="BBcode">//Go through the EntityAspects in the group and grab the corresponding Entity</div><div>//Is this the correct way to do it? &nbsp;Will the .Entity property always have a value?</div><div>var entities = aNonEmptyGroup.Select(entityAspect =&gt; entityAspect.Entity);</div><div><br></div><div>//Save the entities in the given group out to the stream</div><div>_entityManager.CacheStateManager.SaveCacheState(entities, dummyStream);</pre></td></tr></table></div><div>My question is whether the code above is the best approach. &nbsp;Also, I guess this is a breaking change that could be documented? &nbsp;Unless it's actually a bug and I should be able to use my original code in 6.1.3.1?</div><div><br></div><div>Thanks!</div><div>-Stephen</div>]]>
   </description>
   <pubDate>Fri, 21 Oct 2011 17:03:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3049&amp;PID=11923#11923</guid>
  </item> 
 </channel>
</rss>