<?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 : Stop EntityManager from refreshing entities</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Stop EntityManager from refreshing entities</description>
  <pubDate>Sun, 12 Apr 2026 08:51:00 -700</pubDate>
  <lastBuildDate>Thu, 26 Jan 2012 10:05:42 -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=3232</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>Stop EntityManager from refreshing entities :   Thanks! Fixed. </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3232&amp;PID=12550#12550</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> 3232<br /><strong>Posted:</strong> 26-Jan-2012 at 10:05am<br /><br />Thanks! <div>&nbsp;</div><div>Fixed.</div>]]>
   </description>
   <pubDate>Thu, 26 Jan 2012 10:05:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3232&amp;PID=12550#12550</guid>
  </item> 
  <item>
   <title>Stop EntityManager from refreshing entities :   Thanks! It worked. You had...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3232&amp;PID=12546#12546</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3232<br /><strong>Posted:</strong> 25-Jan-2012 at 2:39pm<br /><br />Thanks! It worked. You had typo, line should read:<div>&nbsp;</div><div>options.EntityTypesExcludedFromPostSaveRefetch = new Type&#091;&#093; {mySavedEntity.GetType()};</div>]]>
   </description>
   <pubDate>Wed, 25 Jan 2012 14:39:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3232&amp;PID=12546#12546</guid>
  </item> 
  <item>
   <title>Stop EntityManager from refreshing entities :     Hi katit,You could use...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3232&amp;PID=12541#12541</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> 3232<br /><strong>Posted:</strong> 24-Jan-2012 at 3:01pm<br /><br />Hi katit,<div>&nbsp;</div><div>You could use <em>EntityTypesExcludedFromPostSaveRefetch</em>:</div><div>&nbsp;</div><div>SaveOptions options = new SaveOptions();</div><div>options.EntityTypesExcludedFromPostSaveRefetch = new Type&#091;&#093; {mySavedEntity.GetType()};</div><div>mgr.SaveChangesAsync(options, saveOp =&gt; {</div><div>&nbsp; if (saveOp.CompletedSuccessfully) {</div><div>&nbsp;&nbsp;&nbsp; // ...</div><div>&nbsp; }</div><div>});</div><div>&nbsp;</div><div>While the PKs and FKs will be resolved, the entities'&nbsp;EntityState will not be updated (although it shoudn't be an issue since you are exitting).</div><div>&nbsp;</div><div>Regards,</div><div>&nbsp;&nbsp; Silvio.</div><span style="font-size:10px"><br /><br />Edited by sbelini - 26-Jan-2012 at 10:05am</span>]]>
   </description>
   <pubDate>Tue, 24 Jan 2012 15:01:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3232&amp;PID=12541#12541</guid>
  </item> 
  <item>
   <title>Stop EntityManager from refreshing entities :   I&amp;#039;m not sure if it is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3232&amp;PID=12540#12540</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1264" rel="nofollow">katit</a><br /><strong>Subject:</strong> 3232<br /><strong>Posted:</strong> 24-Jan-2012 at 2:16pm<br /><br />I'm not sure if it is EF or DevForce behavior (I assume it is EF) but would like to know if I can stop it.<div>&nbsp;</div><div>I'm sharing same model on server between my Silverlight project and using it on server for WCF services. In case of services - all calls are in and out and have very small scope..</div><div>&nbsp;</div><div>Here is example picture of what I see in Profiler:</div><div>&nbsp;</div><div><img src="uploads/1264/01242012.PNG" height="164" width="962" border="0" /></div><div>&nbsp;</div><div>Basically, I persist my entities and EF automatically refereshes it's state - loading keys, etc.</div><div>&nbsp;</div><div>But I KNOW that this is my last call and service will exit after that. How can I control if it's even possible so EF doesn't refresh itself and doesn't issue those additional selects against database? Trying to optimize as much as I can</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Tue, 24 Jan 2012 14:16:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3232&amp;PID=12540#12540</guid>
  </item> 
 </channel>
</rss>