<?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"
	>
<channel>
	<title>Comments on: Projecting Onto a Presentation Model with the Entity Framework and ASP.NET MVC</title>
	<atom:link href="http://blogs.teamb.com/craigstuntz/2009/12/31/38500/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.teamb.com/craigstuntz/2009/12/31/38500/</link>
	<description>C# • Entity Framework • Functional Programming • MVC • Web</description>
	<pubDate>Sun, 12 Feb 2012 05:12:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: annuaire de casinos</title>
		<link>http://blogs.teamb.com/craigstuntz/2009/12/31/38500/#comment-18634</link>
		<dc:creator>annuaire de casinos</dc:creator>
		<pubDate>Mon, 27 Sep 2010 06:49:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/?p=38500#comment-18634</guid>
		<description>can u punlish the sample application.</description>
		<content:encoded><![CDATA[<p>can u punlish the sample application.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WB</title>
		<link>http://blogs.teamb.com/craigstuntz/2009/12/31/38500/#comment-18259</link>
		<dc:creator>WB</dc:creator>
		<pubDate>Fri, 10 Sep 2010 15:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/?p=38500#comment-18259</guid>
		<description>I laughed out loud at the Flair count property. 

It's been a long time since a code snippet has brought a smile to face and I was told I could laugh at a reasonable level in my cube.</description>
		<content:encoded><![CDATA[<p>I laughed out loud at the Flair count property. </p>
<p>It&#8217;s been a long time since a code snippet has brought a smile to face and I was told I could laugh at a reasonable level in my cube.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryce</title>
		<link>http://blogs.teamb.com/craigstuntz/2009/12/31/38500/#comment-17991</link>
		<dc:creator>Bryce</dc:creator>
		<pubDate>Wed, 25 Aug 2010 05:51:13 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/?p=38500#comment-17991</guid>
		<description>Can you publish the complete script or ap?</description>
		<content:encoded><![CDATA[<p>Can you publish the complete script or ap?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Reineri</title>
		<link>http://blogs.teamb.com/craigstuntz/2009/12/31/38500/#comment-16227</link>
		<dc:creator>Jim Reineri</dc:creator>
		<pubDate>Thu, 06 May 2010 23:55:44 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/?p=38500#comment-16227</guid>
		<description>I just stumbled onto this article and even tho it is over four months old I do have a question/comment.
Is it not true that it is actually LINQ that is responsible for the ease of creating the projection and not Entity Framework?  It seems that LINQ could be used in this way with LINQ to Objects, LINQ to XML etc.  Without EF at all.</description>
		<content:encoded><![CDATA[<p>I just stumbled onto this article and even tho it is over four months old I do have a question/comment.<br />
Is it not true that it is actually LINQ that is responsible for the ease of creating the projection and not Entity Framework?  It seems that LINQ could be used in this way with LINQ to Objects, LINQ to XML etc.  Without EF at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NW</title>
		<link>http://blogs.teamb.com/craigstuntz/2009/12/31/38500/#comment-13591</link>
		<dc:creator>NW</dc:creator>
		<pubDate>Tue, 26 Jan 2010 20:30:07 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/?p=38500#comment-13591</guid>
		<description>I'm having an issue trying to project on to a presentation model where a parent object has a list of references to child objects. Let's say I have a Parent entity and a Child entity, and in the storage model, each Child has a reference to a single parent. In my presentation model, I want a PresentationParent to have a List. I'm trying to construct this with a query like so:

&lt;code&gt;from p in entities.Parent 
select new PresentationParent { 
    ID = p.ID, 
    Name = p.Name, 
    Age = p.Age, 
    Children = (from c in p.Children 
                select new PresentationChild { 
                    ID = c.ID, 
                    Name = c.Name, 
                    Age = c.Age 
                }).ToList() 
} &lt;/code&gt;

I get an exception at runtime when I try to enumerate the results that LINQ to Entities "doesn't recognize" the ToList() method. It works fine if I'm using LINQ to SQL. Is there a way to do this using LINQ to Entities?

&lt;blockquote&gt;&lt;em&gt;&lt;strong&gt;Response:&lt;/strong&gt; Your &lt;code&gt;ToList&lt;/code&gt; is in the wrong place. Try: &lt;/em&gt;

&lt;code&gt;from p in entities.Parent 
select new PresentationParent { 
    ID = p.ID, 
    Name = p.Name, 
    Age = p.Age, 
    Children = (from c in p.Children 
                select new PresentationChild { 
                    ID = c.ID, 
                    Name = c.Name, 
                    Age = c.Age 
                })
    }).ToList();
&lt;/code&gt;&lt;/blockquote&gt;

</description>
		<content:encoded><![CDATA[<p>I&#8217;m having an issue trying to project on to a presentation model where a parent object has a list of references to child objects. Let&#8217;s say I have a Parent entity and a Child entity, and in the storage model, each Child has a reference to a single parent. In my presentation model, I want a PresentationParent to have a List. I&#8217;m trying to construct this with a query like so:</p>
<p><code>from p in entities.Parent<br />
select new PresentationParent {<br />
    ID = p.ID,<br />
    Name = p.Name,<br />
    Age = p.Age,<br />
    Children = (from c in p.Children<br />
                select new PresentationChild {<br />
                    ID = c.ID,<br />
                    Name = c.Name,<br />
                    Age = c.Age<br />
                }).ToList()<br />
} </code></p>
<p>I get an exception at runtime when I try to enumerate the results that LINQ to Entities "doesn&#8217;t recognize" the ToList() method. It works fine if I&#8217;m using LINQ to SQL. Is there a way to do this using LINQ to Entities?</p>
<blockquote><p><em><strong>Response:</strong> Your <code>ToList</code> is in the wrong place. Try: </em></p>
<p><code>from p in entities.Parent<br />
select new PresentationParent {<br />
    ID = p.ID,<br />
    Name = p.Name,<br />
    Age = p.Age,<br />
    Children = (from c in p.Children<br />
                select new PresentationChild {<br />
                    ID = c.ID,<br />
                    Name = c.Name,<br />
                    Age = c.Age<br />
                })<br />
    }).ToList();<br />
</code></p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: J.W.</title>
		<link>http://blogs.teamb.com/craigstuntz/2009/12/31/38500/#comment-13119</link>
		<dc:creator>J.W.</dc:creator>
		<pubDate>Tue, 05 Jan 2010 13:10:36 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/craigstuntz/?p=38500#comment-13119</guid>
		<description>Hi, Graig, do you have a sample application that can be downloaded?
&lt;blockquote&gt;&lt;i&gt;&lt;b&gt;Response:&lt;/b&gt; Not yet. Soon, though.&lt;/i&gt;&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>Hi, Graig, do you have a sample application that can be downloaded?</p>
<blockquote><p><i><b>Response:</b> Not yet. Soon, though.</i></p></blockquote>
]]></content:encoded>
	</item>
</channel>
</rss>

