<?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 : Lazy Loading</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2012 : Lazy Loading</description>
  <pubDate>Fri, 10 Apr 2026 18:55:20 -700</pubDate>
  <lastBuildDate>Wed, 10 Oct 2012 10:43:12 -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=3706</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>Lazy Loading : The Entity I am trying to query...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14813#14813</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 10:43am<br /><br /><div>The Entity I am trying to query is an association table with a type column. The type column determines one entity it links off to. Example. OrganizationContactAssociation { OrganizationId, ContactId, Id, AssociationType }</div><div>If AssociationType = Email then Id is an EmailId and the Navigation Property for ContactEmail is the correct one to use.</div><div><br></div><div>Because of this I tried:</div><div><div>return await DataService.EntityManager.OrganizationContactAssociations</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Where(e =&gt; e.InActive == false &amp;&amp; e.ContactId == pContactId)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactAddress)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactAddress.Address)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactAddress.Type)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactPhone)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactPhone.Phone)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactPhone.Type)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactJobTitle)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactJobTitle.JobTitle)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactEmail)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactEmail.Email)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .ExecuteAsync();</div></div><div><br></div><div>This causes an inner join on each table rather then a left join.</div><div><br></div><div>I tried changing the Id to allow nulls which then allows the references to be 0 to many. This causes an error.</div><div><br></div>I tried creating Entities of type OrganizationContactAssociation for each type. This does not allow me to query those sub/inherited entities directly.<div><br></div><div>I tried querying each individual type&nbsp;separately, this causes only the last query to be in the cache. I can not allow for the lazy load type because I have a deleted state to each entity, and do not delete any entities. Therefore, I can only display those entities where the deleted states is false.<br><div><br></div><div><br></div></div>]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 10:43:12 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14813#14813</guid>
  </item> 
  <item>
   <title>Lazy Loading : They are coming back as Inner...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14812#14812</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 10:23am<br /><br />They are coming back as Inner Joins. How do i change it to be Left or Right joins? My assumptions is that an Include would only pull that data that applies, implying a left/right join, and not an inner.]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 10:23:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14812#14812</guid>
  </item> 
  <item>
   <title>Lazy Loading :   EF generates the SQL based...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14810#14810</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 9:44am<br /><br />EF generates the SQL based on the relationships in the model, and will use inner and outer joins as needed for the Included relations.<div>&nbsp;</div><div>I'd check the generated SQL (SQL Server Profiler is a handy tool if you're running SQL Server) to see what the generated query looks like.&nbsp; If there are any inner joins, then I'd double check the definition of that relationship in the EDM.</div>]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 09:44:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14810#14810</guid>
  </item> 
  <item>
   <title>Lazy Loading :  To resolve I set load strategy...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14809#14809</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 9:25am<br /><br />To resolve I set load strategy on my entire EntityManager to EntityReferenceLoadStrategy.DoNotLoad.<div><br></div><div>When I run:&nbsp;</div><div><br></div><div><div>&nbsp;return await DataService.EntityManager.OrganizationContactAssociations</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Where(e =&gt; e.InActive == false &amp;&amp; e.ContactId == pContactId)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .ExecuteAsync();</div></div><div><br></div><div>I get the appropriate records</div><div><br></div><div>When I run:</div><div><div>&nbsp;return await DataService.EntityManager.OrganizationContactAssociations</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Where(e =&gt; e.InActive == false &amp;&amp; e.ContactId == pContactId)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactEmail)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactEmail.Email)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactJobTitle)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.ContactJobTitle.JobTitle)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .ExecuteAsync();</div></div><div><br></div><div>I get nothing.</div><div><br></div><div>If I add 1 include I get records, 2 or more and I get nothing.</div><div><br></div><div>It appears that the Include is performing a join.</div><div><br></div><div>Can you lend me some&nbsp;guidance.</div><span style="font-size:10px"><br /><br />Edited by orcities - 10-Oct-2012 at 9:27am</span>]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 09:25:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14809#14809</guid>
  </item> 
  <item>
   <title>Lazy Loading :   OK :).The EntityReferenceLoadStrategy...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14808#14808</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 9:22am<br /><br />OK :).<div>&nbsp;</div><div>The EntityReferenceLoadStrategy of "Load" will always force the navigation property to be reloaded from the data source.&nbsp;&nbsp; And when async navigation is enabled, as it will be in Windows Store apps, the resulting navigation will be a pending entity or pending entity list.</div><div>&nbsp;</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 09:22:38 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14808#14808</guid>
  </item> 
  <item>
   <title>Lazy Loading : Nevermind got it. </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14807#14807</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 8:56am<br /><br />Nevermind got it.]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 08:56:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14807#14807</guid>
  </item> 
  <item>
   <title>Lazy Loading : Also, even when I set to load...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14806#14806</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 8:54am<br /><br />Also, even when I set to load from the datasource everytime &nbsp;a specific instance still loads lazy.<div><br></div><div>I set the entire entity manager to load only from source.&nbsp;</div>]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 08:54:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14806#14806</guid>
  </item> 
  <item>
   <title>Lazy Loading : Thank you for this response. This...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14805#14805</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 8:47am<br /><br />Thank you for this response. This fixed the lazy loading issue but now when I do the following the Included properties don't load:<div><div><br></div><div><div>return await EntityManager.ContactEmails</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Where(e =&gt; e.InActive == false &amp;&amp; e.ContactId == pContactId)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Include(e =&gt; e.Email)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .ExecuteAsync();</div></div></div><div><br></div><div>EntityManager.DefaultEntityReferenceStrategy = new EntityReferenceStrategy(EntityReferenceLoadStrategy.Load, MergeStrategy.OverwriteChanges, true);</div>]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 08:47:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14805#14805</guid>
  </item> 
  <item>
   <title>Lazy Loading :   My guess is you&amp;#039;re setting...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14803#14803</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 8:33am<br /><br />My guess is you're setting the "Lazy Loading Enabled" property within the EDM Designer.&nbsp;&nbsp; DevForce doesn't actually use this setting, it's used by EF in an EF only model.&nbsp; Confusing, I know, but this was true in DevForce 2010 as well.<div>&nbsp;</div><div>The correct way to turn lazy loading within DevForce off is via the EntityReferenceStrategy.&nbsp; More here - <a href="http://drc.ideablade.com/devforce-2012/bin/view/&#068;ocumentati&#111;n/navigati&#111;n-properties-data-retrieval" target="_blank">http://drc.ideablade.com/devforce-2012/bin/view/Documentation/navigation-properties-data-retrieval</a>.&nbsp;</div>]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 08:33:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14803#14803</guid>
  </item> 
  <item>
   <title>Lazy Loading : I am building a WinRt app. I have...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14802#14802</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 3706<br /><strong>Posted:</strong> 10-Oct-2012 at 8:20am<br /><br />I am building a WinRt app. I have a Web Server component storing my DataModel and a seperate winrt library project holding the winrt version of the app, similar to how silverlight is done.<div><br></div><div>I noticed that when I set my models LazyLoading property to false it still lazy loads. I have tried rebuilding the project as well as restarting iis. Nothing changes the outcome. I do not want lazy loading.</div>]]>
   </description>
   <pubDate>Wed, 10 Oct 2012 08:20:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3706&amp;PID=14802#14802</guid>
  </item> 
 </channel>
</rss>