<?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 : query inherited entities</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : query inherited entities</description>
  <pubDate>Wed, 24 Jun 2026 01:32:59 -700</pubDate>
  <lastBuildDate>Thu, 30 Sep 2010 10:48:33 -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=2198</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>query inherited entities : Hi sky40627;The reason is that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8678#8678</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2198<br /><strong>Posted:</strong> 30-Sep-2010 at 10:48am<br /><br />Hi sky40627;<div><br></div><div>The reason is that the line</div><div><br></div><div>query.ToList();</div><div><br></div><div>performs an immediate execution of the query.</div><div><br></div><div>This is true for other clauses such as First(), FirstOrNullEntity(), FirstOrDefault(), etc.</div>]]>
   </description>
   <pubDate>Thu, 30 Sep 2010 10:48:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8678#8678</guid>
  </item> 
  <item>
   <title>query inherited entities : you can ignore last question,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8668#8668</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=595" rel="nofollow">sky40627</a><br /><strong>Subject:</strong> 2198<br /><strong>Posted:</strong> 29-Sep-2010 at 4:24am<br /><br />you can ignore last question, Name was not a database Property<DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 29 Sep 2010 04:24:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8668#8668</guid>
  </item> 
  <item>
   <title>query inherited entities : I have yet another question  The...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8667#8667</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=595" rel="nofollow">sky40627</a><br /><strong>Subject:</strong> 2198<br /><strong>Posted:</strong> 29-Sep-2010 at 4:13am<br /><br />I have yet another question<DIV>&nbsp;</DIV><DIV>The specified type member 'Name' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.</DIV><DIV>&nbsp;</DIV><DIV>is the error I get when doing this</DIV><DIV>&nbsp;</DIV><DIV>BindableList&lt;Customer&gt; _bl = new BindableList&lt;Customer&gt;();<BR>BindingSource _bs = new BindingSource();<BR>_bs.DataSource = _bl;</DIV><DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var qry =_entityManager.Countries<BR>==&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(c =&gt; c.Name.Contains(pValue));</DIV><DIV>&nbsp;</DIV><DIV>_bl.ReplaceRange(qry.ToList());</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>what is the reason for this ? I cannot use "Name" as an entity property ?</DIV>]]>
   </description>
   <pubDate>Wed, 29 Sep 2010 04:13:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8667#8667</guid>
  </item> 
  <item>
   <title>query inherited entities : BindableList&amp;lt;Employee&amp;gt; _bl...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8666#8666</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=595" rel="nofollow">sky40627</a><br /><strong>Subject:</strong> 2198<br /><strong>Posted:</strong> 29-Sep-2010 at 1:57am<br /><br /><DIV>BindableList&lt;Employee&gt; _bl = new BindableList&lt;Employee&gt;();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BindingSource _bs = new BindingSource();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _bs.DataSource = _bl;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IEntityQuery&lt;Employee&gt; qry = (IEntityQuery&lt;Employee&gt;)_entityManager.BasePersons<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Include(Employee.PathFor(b =&gt; b.Address))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Include(Employee.PathFor(b =&gt; b.Address.Country))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(b =&gt; b.Name.Contains(pValue))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _bl.ReplaceRange(qry.ToList().OfType&lt;Employee&gt;()<BR>);</DIV><DIV>&nbsp;</DIV><DIV>I changed to this and it works fine, why ?</DIV><DIV>&nbsp;</DIV><DIV>Can somebody explain this to me ?</DIV>]]>
   </description>
   <pubDate>Wed, 29 Sep 2010 01:57:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8666#8666</guid>
  </item> 
  <item>
   <title>query inherited entities : when performing this query  BindableList&amp;lt;Employee&amp;gt;...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8654#8654</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=595" rel="nofollow">sky40627</a><br /><strong>Subject:</strong> 2198<br /><strong>Posted:</strong> 28-Sep-2010 at 7:41am<br /><br />when performing this query<DIV>&nbsp;</DIV><DIV>&nbsp;BindableList&lt;Employee&gt; _bl = new BindableList&lt;Employee&gt;();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BindingSource _bs = new BindingSource();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _bs.DataSource = _bl;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IEntityQuery&lt;Employee&gt; qry = (IEntityQuery&lt;Employee&gt;)_entityManager.BasePersons<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Include(Employee.PathFor(b =&gt; b.Address))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Include(Employee.PathFor(b =&gt; b.Address.Country))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(b =&gt; b.Name.Contains(pValue))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .OfType&lt;Employee&gt;()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _bl.ReplaceRange(qry);</DIV><DIV>&nbsp;</DIV><DIV>where Employees are inherited from BasePersons</DIV><DIV>&nbsp;</DIV><DIV>the sql query does not perform the include (there is no join in the sql statement)&nbsp;so the application ends up fetching all Addresses one by one</DIV><DIV>&nbsp;</DIV><DIV>when doing this query for all basepersons then it is ok</DIV><DIV>&nbsp;</DIV><DIV>What is the problem here ?</DIV>]]>
   </description>
   <pubDate>Tue, 28 Sep 2010 07:41:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2198&amp;PID=8654#8654</guid>
  </item> 
 </channel>
</rss>