<?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 : Include with Inheritance</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Include with Inheritance</description>
  <pubDate>Tue, 21 Apr 2026 20:46:33 -700</pubDate>
  <lastBuildDate>Tue, 27 Jul 2010 17:48:23 -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=2014</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>Include with Inheritance : That&amp;#039;s a great suggestion...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2014&amp;PID=7836#7836</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=838" rel="nofollow">rhaney</a><br /><strong>Subject:</strong> 2014<br /><strong>Posted:</strong> 27-Jul-2010 at 5:48pm<br /><br />That's a great suggestion :-)....in fact, I like it a lot better than the Include statements....(strongly typed, deep eager loading...)<DIV>&nbsp;</DIV><DIV>Will try it out....thanks!</DIV>]]>
   </description>
   <pubDate>Tue, 27 Jul 2010 17:48:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2014&amp;PID=7836#7836</guid>
  </item> 
  <item>
   <title>Include with Inheritance : Good question. The .Include functionality...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2014&amp;PID=7835#7835</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 2014<br /><strong>Posted:</strong> 27-Jul-2010 at 5:42pm<br /><br /><DIV>Good question.&nbsp; The .Include functionality in LINQ (which we mirror) does not support this, but you can do this by using a projection in DevForce.&nbsp; I believe the query below should accomplish what you were trying to do.&nbsp; It returns an anonymous type, but all of the various components will still be brought into the DevForce cache.</DIV><DIV>&nbsp;</DIV><DIV>var&nbsp;results = em.Catalogs.Select(c =&gt; new {</DIV><DIV>&nbsp;&nbsp;Catalog = c,</DIV><DIV>&nbsp;&nbsp;Products = c.Products,</DIV><DIV>&nbsp;&nbsp;Authors =&nbsp;c.Products.OfType&lt;Book&gt;().Select(b =&gt; b.Author),</DIV><DIV>&nbsp; Directors = c.Products.OfType&lt;Dvd&gt;().Select(d =&gt; d.Director)</DIV><DIV>&nbsp;}).Execute();</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by ting - 27-Jul-2010 at 5:42pm</span>]]>
   </description>
   <pubDate>Tue, 27 Jul 2010 17:42:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2014&amp;PID=7835#7835</guid>
  </item> 
  <item>
   <title>Include with Inheritance : Let&amp;#039;s say I have an e-commerce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2014&amp;PID=7830#7830</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=838" rel="nofollow">rhaney</a><br /><strong>Subject:</strong> 2014<br /><strong>Posted:</strong> 27-Jul-2010 at 3:29pm<br /><br /><P>Let's say I have an e-commerce site, with different types of products.&nbsp; For instance, books and dvds.&nbsp; I create a model with the following entities:</P><DIV>Catalog</DIV><DIV>Product</DIV><DIV>Book (of type Product)</DIV><DIV>Dvd (of type Product)</DIV><DIV>Author</DIV><DIV>Director</DIV><DIV>&nbsp;</DIV><DIV>Catalog has Products (Books/Dvds)</DIV><DIV>Book has a collection of Authors</DIV><DIV>Dvd has a single Director</DIV><DIV>&nbsp;</DIV><DIV>How would I eager load information about Books and Dvds in the same query?</DIV><DIV>&nbsp;</DIV><DIV>I tried the following, but get an exception:</DIV><DIV>var query = from c in em.Catalogs.AddIncludePaths("Products, "Products.Authors", "Products.Director");</DIV><DIV>&nbsp;</DIV><DIV>I was thinking a Silverlight like syntax might be nice:</DIV><DIV>var query = from c in em.Catalogs.AddIncludePaths("Products, "Products.(Book.Authors)", "Products.(Dvd.Director)");</DIV><DIV>&nbsp;</DIV><DIV>Does such a syntax exist?</DIV>]]>
   </description>
   <pubDate>Tue, 27 Jul 2010 15:29:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2014&amp;PID=7830#7830</guid>
  </item> 
 </channel>
</rss>