<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Transparent Lazy Loading for Entity Framework – part 2</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx</link><description>This post is a part of the series that describes EFLazyLoading library. Part 1 - Strategies for implementing lazy loading Part 2 - Implementation of EFLazyLoading Part 3 - Anatomy of a Stub As I promised last time , I would like to present the result</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Jaroslaw Kowalski : Transparent Lazy Loading for Entity Framework ??? part 1</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8497039</link><pubDate>Tue, 13 May 2008 00:34:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8497039</guid><dc:creator>Jaroslaw Kowalski : Transparent Lazy Loading for Entity Framework ??? part 1</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-1.aspx"&gt;http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-1.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Entity Framework et Lazy Loading</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8499098</link><pubDate>Tue, 13 May 2008 09:19:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8499098</guid><dc:creator>Matthieu MEZIL</dc:creator><description>&lt;p&gt;R&amp;#233;guli&amp;#232;rement quand je parle de l'Entity Framework, on me reproche tr&amp;#232;s souvent l'absence de Lazy Loading.&lt;/p&gt;
</description></item><item><title>re: Transparent Lazy Loading for Entity Framework – part 2</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8501754</link><pubDate>Wed, 14 May 2008 00:15:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8501754</guid><dc:creator>daveblack</dc:creator><description>&lt;p&gt;Thank you so much for providing this &amp;quot;extension&amp;quot; to EF! &amp;nbsp;It makes my code much more simple and eases my worries about performance.&lt;/p&gt;
</description></item><item><title>Entity Framework and Lazy Loading</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8519531</link><pubDate>Mon, 19 May 2008 22:26:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8519531</guid><dc:creator>Hot Topics</dc:creator><description>&lt;p&gt;There has been a lot of discussions lately about Entity Framework and Lazy Loading as well as some solutions&lt;/p&gt;</description></item><item><title>Transparent Lazy Loading pro Entity Framework</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8524074</link><pubDate>Tue, 20 May 2008 20:49:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8524074</guid><dc:creator>x2develop: Jiří Činčura</dc:creator><description>&lt;p&gt;Jaroslaw Kowalski napsal&amp;#160;pěkn&amp;#233;&amp;#160;posty&amp;#160;o&amp;#160;tom,&amp;#160;jak&amp;#160;&amp;quot;vyrobit&amp;quot;&amp;#160;transparent lazy loading&amp;#160;v&amp;#160;EF&amp;#160;a&amp;#160;připravil&amp;#160;i&lt;/p&gt;
</description></item><item><title>re: Transparent Lazy Loading for Entity Framework – part 2</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8537693</link><pubDate>Fri, 23 May 2008 11:06:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8537693</guid><dc:creator>jamal@mavadat.net</dc:creator><description>&lt;p&gt;Brilliant job!&lt;/p&gt;
&lt;p&gt;I loved the way you mixed generics and lamba expressions. Just reminds me those C++ template library designs, and yep, after few years we've got the basis for &amp;quot;beautiful&amp;quot; coding!!!&lt;/p&gt;
&lt;p&gt;Jamal Mavadat&lt;/p&gt;
</description></item><item><title>Transparent Lazy Loading for Entity Framework – part 3 – Anatomy of a Stub</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8556734</link><pubDate>Wed, 28 May 2008 19:38:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8556734</guid><dc:creator>Jaroslaw Kowalski</dc:creator><description>&lt;p&gt;In two previous articles ( part1 and part2 ) I have introduced EFLazyLoading &amp;amp;#8211; a framework for&lt;/p&gt;
</description></item><item><title>Paplašināta Entity Framework</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8580692</link><pubDate>Sun, 08 Jun 2008 15:07:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8580692</guid><dc:creator>SiTox.NET</dc:creator><description>&lt;p&gt;Ar dažām jaunām tehnoloģijām ir tā, ka tās izlaiž, parāda kaut kādas jaunas „features”, bet praksē tie&lt;/p&gt;
</description></item><item><title>More on Lazy Loading in Entity Framework</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8594405</link><pubDate>Fri, 13 Jun 2008 15:15:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8594405</guid><dc:creator>Hot Topics</dc:creator><description>&lt;p&gt;Jarek Kowalski continues his series on implementing Transparent Lazy Loading in the EF. &amp;amp;#160; Part 1&lt;/p&gt;
</description></item><item><title>Risks with Transparent Lazy Loading for EF</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8644449</link><pubDate>Tue, 24 Jun 2008 03:24:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8644449</guid><dc:creator>WardB</dc:creator><description>&lt;p&gt;I fear there are at least two problems with your approach, the first of which is most severe.&lt;/p&gt;
&lt;p&gt;Risk of wrong result: If the foreign key id for the customer of an order is 42 but there is no customer with id=42, anOrder.Customer reports that the customer exists when, in fact, it does not. The moment you write anOrder.Customer.Name you will blow when you go to fetch the customer .. and get nothing.&lt;/p&gt;
&lt;p&gt;[aside: you and Entity Framework have chosen not to use the NULL OBJECT pattern so you have to litter your code with tests for null entities. In this case, you postpone the day of reckoning.]&lt;/p&gt;
&lt;p&gt;Inconsistency with EF: In Entity Framework, anOrder.Customer.Load returns null because it does the lookup .. and finds no match. So you are proposing post-load behavior inconsistent with EF's. That's a troublesome design choice.&lt;/p&gt;
&lt;p&gt;Inconsistency within your framework: You are offering a virtual proxy for &amp;quot;reference&amp;quot; properties (order.Customer) but not collection properties (order.Details). &lt;/p&gt;
&lt;p&gt;So what did I miss?&lt;/p&gt;
</description></item><item><title>Transparent Lazy Loading pro Entity Framework</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8729606</link><pubDate>Sun, 13 Jul 2008 23:57:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8729606</guid><dc:creator>Jiří {x2} Činčura</dc:creator><description>&lt;p&gt;Jarek Kowalski napsal pěkn&amp;#233; posty o tom, jak &amp;quot;vyrobit&amp;quot; transparent lazy loading v EF a připravil i progr&amp;#225;mek&lt;/p&gt;
</description></item><item><title>re: Transparent Lazy Loading for Entity Framework – part 2</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8956966</link><pubDate>Thu, 18 Sep 2008 11:42:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8956966</guid><dc:creator>eXcess</dc:creator><description>&lt;p&gt;Hi Jaroslaw, I just wondered what would be the drawback if I would implement lazy loading in our enterprise software through your framework and the Entity Framework version 2 comes out with lazy loading? &lt;/p&gt;
&lt;p&gt;I guess that there'll be breaking changes anyway if we use standard ef v1 and upgrade to ef v2. But I just wanted your thoughts on that? &lt;/p&gt;
</description></item><item><title>re: Transparent Lazy Loading for Entity Framework – part 2</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#8957321</link><pubDate>Thu, 18 Sep 2008 17:02:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8957321</guid><dc:creator>jkowalski</dc:creator><description>&lt;p&gt;In V2 we are making changes in the lazy loading area. It is too early to talk about details, but we are thinking of LL for both POCO objects and code-generated entitites.&lt;/p&gt;
&lt;p&gt;In any case the API will be most likely very different from the one in EFLazyLoading. &lt;/p&gt;
&lt;p&gt;For POCO objects the plan is to support LL through proxies, we are still working on details for EntityObjects and IPOCO.&lt;/p&gt;
&lt;p&gt;If you are interested in POCOs and proxy-based LL, you may want to take a look at EFPocoAdapter sample: (&lt;a rel="nofollow" target="_new" href="http://code.msdn.com/EFPocoAdapter"&gt;http://code.msdn.com/EFPocoAdapter&lt;/a&gt;) which also implements proxies. &lt;/p&gt;
&lt;p&gt;Given than POCOs are really plain objects with no additional APIs on them it should be pretty straightforward to migrate to V2 solution when it becomes available.&lt;/p&gt;
</description></item><item><title>re: Transparent Lazy Loading for Entity Framework – part 2</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#9376338</link><pubDate>Tue, 27 Jan 2009 00:58:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9376338</guid><dc:creator>SvenAelterman</dc:creator><description>&lt;p&gt;Jaroslaw,&lt;/p&gt;
&lt;p&gt;It seems that most solutions that somehow hack EF v1 into lazy loading always require that there is an active ObjectContext. In architectures where you want to use short-lived ObjectContext instances, this isn't feasible.&lt;/p&gt;
&lt;p&gt;For example, I use ObjectContext in my Data Access Layer as follows:&lt;/p&gt;
&lt;p&gt;using (Entities db = new Entities())&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;// Load, etc&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;so, any time I call .Load() or try to load anything, my ObjectContext has already been disposed. &lt;/p&gt;
&lt;p&gt;Is there any workaround that includes recreating an ObjectContext so it can actually go to the data store and retrieve the additional objects.&lt;/p&gt;
&lt;p&gt;Sven.&lt;/p&gt;
</description></item><item><title>re: Transparent Lazy Loading for Entity Framework – part 2</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#9462383</link><pubDate>Fri, 06 Mar 2009 14:11:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9462383</guid><dc:creator>Tanveer Badar</dc:creator><description>&lt;p&gt;@SvenAelterman&lt;/p&gt;
&lt;p&gt;It isn't possible in nHibernate either, the ORM I am most familiar with. nHibernate also requires an active ISession to lazily load objects.&lt;/p&gt;
</description></item><item><title>re: Transparent Lazy Loading for Entity Framework – part 2</title><link>http://blogs.msdn.com/jkowalski/archive/2008/05/12/transparent-lazy-loading-for-entity-framework-part-2.aspx#9585353</link><pubDate>Mon, 04 May 2009 08:08:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9585353</guid><dc:creator>kraeg</dc:creator><description>&lt;p&gt;I feel a bit stupid asking this question... but, how do I 'use' the EFLazyClassGen Code generation application? &amp;nbsp;Where do I put it and how do I get VS 2008 to use it when generating my entities?&lt;/p&gt;
</description></item></channel></rss>