<?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 : Force Refresh of Navigation Properties</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Force Refresh of Navigation Properties</description>
  <pubDate>Tue, 28 Apr 2026 22:45:55 -700</pubDate>
  <lastBuildDate>Tue, 15 Sep 2009 14:04:20 -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=1468</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>Force Refresh of Navigation Properties : Ken:I haven&amp;#039;t tested this,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5391#5391</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> 1468<br /><strong>Posted:</strong> 15-Sep-2009 at 2:04pm<br /><br />Ken:<br><br>I haven't tested this, but I'm told that Reload does work in SL, the same as the usual (implicit) load of related entities – it will be performed asynchronously if the UseAsyncNavigation flag is true on the EntityManager, which it will be for a SL app. &nbsp;This means that you will either need to have a handler in place for PendingEntityListResolved, or check the IsPendingEntityList flag, to determine when the list is reloaded.<br><br>Greg<br><br>]]>
   </description>
   <pubDate>Tue, 15 Sep 2009 14:04:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5391#5391</guid>
  </item> 
  <item>
   <title>Force Refresh of Navigation Properties :   Originally posted by ken.nelsonIs...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5388#5388</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> 1468<br /><strong>Posted:</strong> 15-Sep-2009 at 10:21am<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by ken.nelson</strong></em><br /><br />Is it possible that this feature works in syncronous win forms but not in asynchronous Silverlight apps?&nbsp; Truthfully I was a bit surprised there wasn't a ReloadAsync() method.</td></tr></table><br><br>Oh, sorry, I wasn't paying attention to which forum we're in.&nbsp; Of course it would need to be async. Perhaps we've simply not implemented that yet, in which case you'd just have to do a normal async query to refresh the related entities. I'll check into it.<br>]]>
   </description>
   <pubDate>Tue, 15 Sep 2009 10:21:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5388#5388</guid>
  </item> 
  <item>
   <title>Force Refresh of Navigation Properties : The merge strategy we&amp;#039;re...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5385#5385</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=452" rel="nofollow">ken.nelson</a><br /><strong>Subject:</strong> 1468<br /><strong>Posted:</strong> 15-Sep-2009 at 6:47am<br /><br />The merge strategy we're using is OverwriteChanges, so that shouldn't be the problem.&nbsp; <DIV>&nbsp;</DIV><DIV>I can't speak for a win form console application version because I didn't test that.&nbsp; Is it possible that this feature works in syncronous win forms but not in asynchronous Silverlight apps?&nbsp; Truthfully I was a bit surprised there wasn't a ReloadAsync() method.</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by ken.nelson - 15-Sep-2009 at 6:48am</span>]]>
   </description>
   <pubDate>Tue, 15 Sep 2009 06:47:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5385#5385</guid>
  </item> 
  <item>
   <title>Force Refresh of Navigation Properties : Reload() should do it, and it...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5382#5382</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> 1468<br /><strong>Posted:</strong> 14-Sep-2009 at 2:46pm<br /><br />Reload() should do it, and it seems to work for me.&nbsp; I tested it as follows in a console app against NorthwindIB:<br><br>&nbsp;&nbsp;&nbsp; private void DoIt() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Order anOrder = _mgr.Orders.FirstOrDefault();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine("Order Id = {0}; No. of OrderDetails = {1}", anOrder.OrderID, anOrder.OrderDetails.ToList().Count());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine("Pause here and add an OrderDetail to this outside of this program...");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PromptToContinue();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; anOrder.OrderDetails.Reload(MergeStrategy.PreserveChanges);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine("Order Id = {0}; No. of OrderDetails = {1}", anOrder.OrderID, anOrder.OrderDetails.ToList().Count());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PromptToContinue();<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; private void PromptToContinue() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine("Press ENTER to continue...");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.ReadLine();<br>&nbsp;&nbsp;&nbsp; }<br><br>At the first PromptToContinue(), while execution was paused, I manually changed the OrderId in one or more of the records in the OrderDetail backing table, in such a way as either to add or remove an OrderDetail from the OrderDetails collection of anOrder. The second output of the OrderDetails count shows the change. I tested it both for an increased and a decreased collection, thinking that maybe it only reloaded entities it already had, but it does pick up newly added children as well.<br><br>Of course, the way Reload handles <i></i>externally made changes to an entity that's already in the collection depends upon the MergeStrategy you use. If you use <i>PreserveChanges</i>, for example, then in the case of an entity that has changed both in the cache and externally, you would not pick up the external changes.<br><br>]]>
   </description>
   <pubDate>Mon, 14 Sep 2009 14:46:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5382#5382</guid>
  </item> 
  <item>
   <title>Force Refresh of Navigation Properties : Hi,  Is there any way to force...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5369#5369</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=452" rel="nofollow">ken.nelson</a><br /><strong>Subject:</strong> 1468<br /><strong>Posted:</strong> 11-Sep-2009 at 1:28pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Is there any way to force a refresh/refetch of a navigation property?&nbsp; I've tried a few things, and the most promising appeared to be something along the lines of customer.Orders.Reload(MergeStrategy.OverwriteChanges), but it didn't appear to work.</DIV><DIV>&nbsp;</DIV><DIV>I worked around it by removing the entity from the entity manager, then requerying for the same entity, but that seems less than ideal.&nbsp; Is there a better way of doing this?</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>Ken</DIV>]]>
   </description>
   <pubDate>Fri, 11 Sep 2009 13:28:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1468&amp;PID=5369#5369</guid>
  </item> 
 </channel>
</rss>