<?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 : Filter EntityRelationQuery?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Filter EntityRelationQuery?</description>
  <pubDate>Tue, 12 May 2026 21:25:29 -700</pubDate>
  <lastBuildDate>Wed, 25 Sep 2013 18:30: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=2328</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>Filter EntityRelationQuery? : Sorry, this feature has not been...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=16911#16911</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2328<br /><strong>Posted:</strong> 25-Sep-2013 at 6:30pm<br /><br />Sorry, this feature has not been implemented.&nbsp;&nbsp; Supporting an Include on the converted&nbsp;EntityRelationQuery would also probably lead to other issues&nbsp;when DevForce merges these results into cache.&nbsp; For now, for these situations when you need the Include, your best alternative is to avoid lazy loading and explicitly write an EntityQuery.]]>
   </description>
   <pubDate>Wed, 25 Sep 2013 18:30:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=16911#16911</guid>
  </item> 
  <item>
   <title>Filter EntityRelationQuery? : Has ever been implemented the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=16890#16890</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=2458" rel="nofollow">papuashu</a><br /><strong>Subject:</strong> 2328<br /><strong>Posted:</strong> 25-Sep-2013 at 5:22am<br /><br />Has ever been implemented the feature of converting EntityRelationQuery to EntityQuery?<br />In my case, I need to add Include to an EntityRelationQuery...]]>
   </description>
   <pubDate>Wed, 25 Sep 2013 05:22:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=16890#16890</guid>
  </item> 
  <item>
   <title>Filter EntityRelationQuery? : Hi tersiusk,   Sorry for the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=9223#9223</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2328<br /><strong>Posted:</strong> 23-Nov-2010 at 4:52pm<br /><br />Hi tersiusk, <DIV>&nbsp;</DIV><DIV>Sorry for the mixup.</DIV><DIV>&nbsp;</DIV><DIV>At the moment it's not possible to use .Filter in this scenario. </DIV><DIV>&nbsp;</DIV><DIV>We have a feature request to implement a method to convert an EntityRelationQuery to an EntityQuery which would make possible the use of Filter(). We plan that feature in one of the near coming releases.</DIV><DIV>&nbsp;</DIV><DIV>Kind regards,</DIV><DIV>sbelini</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 16:52:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=9223#9223</guid>
  </item> 
  <item>
   <title>Filter EntityRelationQuery? : Thanks for the reply. I&amp;#039;m...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=9209#9209</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=988" rel="nofollow">tersiusk</a><br /><strong>Subject:</strong> 2328<br /><strong>Posted:</strong> 22-Nov-2010 at 11:46pm<br /><br /><div><div>Thanks for the reply. I'm not exactly sure that is what I was&nbsp;referring to.</div><div><br></div><div>Here is a quick code sample of what I was trying to do.&nbsp;<span ="Apple-style-span" style="font-size: 11.6667px; ">&nbsp;This does not seem to be working. I was looking for a way to filter the default generated relation properties but it looks like it's not possible?&nbsp;</span></div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div>static void em_Querying(object sender, EntityQueryingEventArgs e)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (InterceptQueries)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IEntityQuery newQuery = null;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (e.Query.QueryableType == typeof (Application) &amp;&amp; e.Query is EntityRelationQuery)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div><span ="Apple-style-span" style="font-size: 11.6667px; "><span ="Apple-tab-span" style="white-space:pre">			</span>newQuery = currentQuery.Filter((IQueryable&lt;Application&gt; q) =&gt; q.</span></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span ="Apple-tab-span" style="white-space:pre">	</span>Where(a =&gt; a.ApplicationID == User.CurrentUser.applicationID));</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div></div><div><span ="Apple-tab-span" style="white-space:pre">		</span></div><div><span ="Apple-tab-span" style="white-space:pre">		e.Query = newQuery ?? e.Query;</span></div><div><span ="Apple-tab-span" style="white-space:pre">	</span>}</div><div>}</div><div><span ="Apple-style-span" style="font-size: 11.6667px; "></pre></td></tr></table></span></div>]]>
   </description>
   <pubDate>Mon, 22 Nov 2010 23:46:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=9209#9209</guid>
  </item> 
  <item>
   <title>Filter EntityRelationQuery? : Hi tersiusk,   You can trigger...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=9199#9199</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2328<br /><strong>Posted:</strong> 22-Nov-2010 at 2:55pm<br /><br />Hi tersiusk, <DIV>&nbsp;</DIV><DIV>You can trigger the filters by using Select().</DIV><DIV>In the example below (based on NorthwindIB) both filters for Employees and Orders will fire:</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT><FONT size=2><FONT face=C&#111;nsolas> employeesQuery = mgr.Employees<BR>&nbsp; .Select(eo =&gt; <FONT color=#0000ff><FONT color=#0000ff><FONT color=#0000ff>new</FONT></FONT></FONT> { employees = eo, orders = eo.Orders.Where(o =&gt; <FONT color=#0000ff><FONT color=#0000ff><FONT color=#0000ff>true</FONT></FONT></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas>) })<BR>&nbsp; .ToList()<BR>&nbsp; .Select(eo =&gt; eo.employees)<BR>&nbsp; .ToList();<BR></FONT></DIV><DIV>Regards,</DIV><DIV>&nbsp;&nbsp; sbelini.</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by sbelini - 22-Nov-2010 at 2:56pm</span>]]>
   </description>
   <pubDate>Mon, 22 Nov 2010 14:55:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=9199#9199</guid>
  </item> 
  <item>
   <title>Filter EntityRelationQuery? :  HiI would like to add filters...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=9190#9190</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=988" rel="nofollow">tersiusk</a><br /><strong>Subject:</strong> 2328<br /><strong>Posted:</strong> 22-Nov-2010 at 5:16am<br /><br />Hi<div><br></div><div>I would like to add filters on my relationship properties. I'm able to intercept the query on the Querying event but it seems I cannot add a filter to the query itself since the Filter() method only works on EntityQuery and not EntityRelationQuery. Is there another way to filter relationship results?</div><div><br></div><div>I'm trying to do this since the user logs into a certain application context where he should only be able to see certain records which are linked to that context.</div><div><br></div><div><br></div><span style="font-size:10px"><br /><br />Edited by tersiusk - 22-Nov-2010 at 5:17am</span>]]>
   </description>
   <pubDate>Mon, 22 Nov 2010 05:16:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2328&amp;PID=9190#9190</guid>
  </item> 
 </channel>
</rss>