<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Entity Framework 4 &#8211; Using Eager Loading</title>
	<atom:link href="http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/feed/" rel="self" type="application/rss+xml" />
	<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/</link>
	<description></description>
	<lastBuildDate>Sat, 28 Jan 2012 14:35:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Talking about Entity Framework 4 – Using Eager Loading « Roger Alsing Weblog &#171; EdenSoft Space</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1716</link>
		<dc:creator><![CDATA[Talking about Entity Framework 4 – Using Eager Loading « Roger Alsing Weblog &#171; EdenSoft Space]]></dc:creator>
		<pubDate>Mon, 27 Sep 2010 21:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1716</guid>
		<description><![CDATA[[...] Quote  Entity Framework 4 – Using Eager Loading « Roger Alsing Weblog [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Quote  Entity Framework 4 – Using Eager Loading « Roger Alsing Weblog [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: M.W.</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1441</link>
		<dc:creator><![CDATA[M.W.]]></dc:creator>
		<pubDate>Fri, 08 Jan 2010 14:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1441</guid>
		<description><![CDATA[I created an extension method to traverse multiple paths - going from a multiple - to - one set does need something else but this method allows you to pass in multiple properties in a lambda expression:

http://howdoinetmw.blogspot.com/2009/12/how-do-i-create-type-safe-includes-with.html]]></description>
		<content:encoded><![CDATA[<p>I created an extension method to traverse multiple paths &#8211; going from a multiple &#8211; to &#8211; one set does need something else but this method allows you to pass in multiple properties in a lambda expression:</p>
<p><a href="http://howdoinetmw.blogspot.com/2009/12/how-do-i-create-type-safe-includes-with.html" rel="nofollow">http://howdoinetmw.blogspot.com/2009/12/how-do-i-create-type-safe-includes-with.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Alsing</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1352</link>
		<dc:creator><![CDATA[Roger Alsing]]></dc:creator>
		<pubDate>Fri, 21 Aug 2009 08:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1352</guid>
		<description><![CDATA[@Marco, sounds interesting, got any public samples of that?

Do you simply do something like:

public static readonly string SomePath = GetPath&lt;Order&gt;(o =&gt; o.Details);

or how is it done?]]></description>
		<content:encoded><![CDATA[<p>@Marco, sounds interesting, got any public samples of that?</p>
<p>Do you simply do something like:</p>
<p>public static readonly string SomePath = GetPath&lt;Order&gt;(o =&gt; o.Details);</p>
<p>or how is it done?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bdgbd</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1350</link>
		<dc:creator><![CDATA[bdgbd]]></dc:creator>
		<pubDate>Mon, 17 Aug 2009 14:39:06 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1350</guid>
		<description><![CDATA[Why is this in the context of EF4? Current version of EF already has .Include()]]></description>
		<content:encoded><![CDATA[<p>Why is this in the context of EF4? Current version of EF already has .Include()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1349</link>
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Sat, 15 Aug 2009 21:36:09 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1349</guid>
		<description><![CDATA[For what it&#039;s worth, I have been using a hybrid: static readonly strings that get their value from a lambda turned into a string. Good performance (only have the reflection overhead once), I keep programmers from &#039;putting crap in there left and right&#039; and the actual path (lambda or string) only has to be maintained in one spot: if it changes, only one spot to fix it. Kind of comes down to &quot;do whatever works for you&quot;.]]></description>
		<content:encoded><![CDATA[<p>For what it&#8217;s worth, I have been using a hybrid: static readonly strings that get their value from a lambda turned into a string. Good performance (only have the reflection overhead once), I keep programmers from &#8216;putting crap in there left and right&#8217; and the actual path (lambda or string) only has to be maintained in one spot: if it changes, only one spot to fix it. Kind of comes down to &#8220;do whatever works for you&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stijn</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1336</link>
		<dc:creator><![CDATA[Stijn]]></dc:creator>
		<pubDate>Wed, 15 Jul 2009 22:34:05 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1336</guid>
		<description><![CDATA[Definitely true, but there is a guarantee -if used correctly- that future changes to your edm will always keep your queries working. String based includes will never guarantee you on that one.]]></description>
		<content:encoded><![CDATA[<p>Definitely true, but there is a guarantee -if used correctly- that future changes to your edm will always keep your queries working. String based includes will never guarantee you on that one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Alsing</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1335</link>
		<dc:creator><![CDATA[Roger Alsing]]></dc:creator>
		<pubDate>Wed, 15 Jul 2009 21:57:31 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1335</guid>
		<description><![CDATA[The problem with the above solution is that it is only type safe, but not &quot;intention&quot; safe.

There is no compiletime checks for what you pass into a lambda expression.

eg.
I could just as well do:

.Inclue(p =&gt; &quot;yeehaa&quot;)
.Include(p =&gt; p.Supplicers.Sum().ToString())

etc.

There is _nothing_ that prevents the developer to put crap inside those statements.
The only thing it guarantees at compile time is that is a valid expression.]]></description>
		<content:encoded><![CDATA[<p>The problem with the above solution is that it is only type safe, but not &#8220;intention&#8221; safe.</p>
<p>There is no compiletime checks for what you pass into a lambda expression.</p>
<p>eg.<br />
I could just as well do:</p>
<p>.Inclue(p =&gt; &#8220;yeehaa&#8221;)<br />
.Include(p =&gt; p.Supplicers.Sum().ToString())</p>
<p>etc.</p>
<p>There is _nothing_ that prevents the developer to put crap inside those statements.<br />
The only thing it guarantees at compile time is that is a valid expression.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stijn</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1333</link>
		<dc:creator><![CDATA[Stijn]]></dc:creator>
		<pubDate>Tue, 14 Jul 2009 18:10:22 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1333</guid>
		<description><![CDATA[There is already a good way for using lambda&#039;s for eager loading on collections without losing readability:

   1. var query = from p  
   2.     in context.ProductSet  
   3.        .Include(p =&gt; p.PriceHistory)  
   4.        .Include(p =&gt; p.Suppliers.First().Address)  
   5.     where p.SalePrice &gt; 1000  
   6.     select p;  

http://www.codetuning.net/blog/post/Entity-Framework-compile-safe-Includes.aspx

The only difference is you have to use First() on collections, if your coverage is not 100%, which is most often the case in most projects, I would definitely recommend lambda&#039;s over strings. The downside is that it uses reflection, if you care about &quot;micromilliseconds&quot; you should not use this.

But nonetheless, if people prefer strings this is a very maintainable method.]]></description>
		<content:encoded><![CDATA[<p>There is already a good way for using lambda&#8217;s for eager loading on collections without losing readability:</p>
<p>   1. var query = from p<br />
   2.     in context.ProductSet<br />
   3.        .Include(p =&gt; p.PriceHistory)<br />
   4.        .Include(p =&gt; p.Suppliers.First().Address)<br />
   5.     where p.SalePrice &gt; 1000<br />
   6.     select p;  </p>
<p><a href="http://www.codetuning.net/blog/post/Entity-Framework-compile-safe-Includes.aspx" rel="nofollow">http://www.codetuning.net/blog/post/Entity-Framework-compile-safe-Includes.aspx</a></p>
<p>The only difference is you have to use First() on collections, if your coverage is not 100%, which is most often the case in most projects, I would definitely recommend lambda&#8217;s over strings. The downside is that it uses reflection, if you care about &#8220;micromilliseconds&#8221; you should not use this.</p>
<p>But nonetheless, if people prefer strings this is a very maintainable method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fred Morrison</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1203</link>
		<dc:creator><![CDATA[Fred Morrison]]></dc:creator>
		<pubDate>Tue, 26 May 2009 16:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1203</guid>
		<description><![CDATA[100% agree with the danger of implict lazy load.]]></description>
		<content:encoded><![CDATA[<p>100% agree with the danger of implict lazy load.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Alsing</title>
		<link>http://rogeralsing.com/2009/05/24/entity-framework-4-using-eager-loading/#comment-1202</link>
		<dc:creator><![CDATA[Roger Alsing]]></dc:creator>
		<pubDate>Tue, 26 May 2009 15:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://rogeralsing.com/?p=634#comment-1202</guid>
		<description><![CDATA[&gt;&gt;Betting that not all leaves of every node in a tree
&gt;&gt;structure that appears on a web page will be visited by the user 

You can easily deal with this by only eager loading the nodes that you _know_ that you want to touch and leave all other paths unloaded.

I also think that &quot;explicit&quot; lazy load is OK.
Atleast the developer is aware that something is going on there.

&quot;Implicit&quot; Lazy Load is dangerous because it hides explicit behavior which can lead to data consistency problems and severe performance issues.

I say &quot;can&quot; because if you know enough about LL, then it is not much of a problem.
But many many developers are far to unaware about the inner workings of O/R mappers, and thus doesn&#039;t know how to deal with LL.

I&#039;ve seen systems where a single web page issues aprox 1000 DB requests just because the developers didn&#039;t know how to reason about LL.

So what I&#039;m saying is that it is not so much LL itself that is the problem , but the lack of knowledge around the topic in general.]]></description>
		<content:encoded><![CDATA[<p>&gt;&gt;Betting that not all leaves of every node in a tree<br />
&gt;&gt;structure that appears on a web page will be visited by the user </p>
<p>You can easily deal with this by only eager loading the nodes that you _know_ that you want to touch and leave all other paths unloaded.</p>
<p>I also think that &#8220;explicit&#8221; lazy load is OK.<br />
Atleast the developer is aware that something is going on there.</p>
<p>&#8220;Implicit&#8221; Lazy Load is dangerous because it hides explicit behavior which can lead to data consistency problems and severe performance issues.</p>
<p>I say &#8220;can&#8221; because if you know enough about LL, then it is not much of a problem.<br />
But many many developers are far to unaware about the inner workings of O/R mappers, and thus doesn&#8217;t know how to deal with LL.</p>
<p>I&#8217;ve seen systems where a single web page issues aprox 1000 DB requests just because the developers didn&#8217;t know how to reason about LL.</p>
<p>So what I&#8217;m saying is that it is not so much LL itself that is the problem , but the lack of knowledge around the topic in general.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

