<?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 : Predicate Builder Example</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Predicate Builder Example</description>
  <pubDate>Wed, 29 Jul 2026 15:07:59 -700</pubDate>
  <lastBuildDate>Wed, 16 Feb 2011 11:52:48 -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=2486</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>Predicate Builder Example : Hi Markus, Did you try executing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2486&amp;PID=9969#9969</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> 2486<br /><strong>Posted:</strong> 16-Feb-2011 at 11:52am<br /><br /><P>Hi Markus,</P><DIV>Did you try executing your snippet? It won't retrieve any results. (You should be using x.ProductName.Contains(..) )</DIV><DIV>&nbsp;</DIV><DIV>As for where the query gets executed, if it's running against the datasource, it will be executed on the server; if it's against the cache, the execution is in the client.</DIV><DIV>If you haven't explicitly set QueryStrategy, execution will depend on whether it has been executed previously (and therefore in the QueryCache, which will trigger a cache query) or not.</DIV><DIV>&nbsp;</DIV><DIV>You can find more information on <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/Query-Strategy" target="_blank">QueryStrategy</A> and <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/Entity-Cache" target="_blank">QueryCache</A>&nbsp;in our DevForce Resource Center.</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>&nbsp;&nbsp; Silvio.</DIV><span style="font-size:10px"><br /><br />Edited by sbelini - 16-Feb-2011 at 12:01pm</span>]]>
   </description>
   <pubDate>Wed, 16 Feb 2011 11:52:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2486&amp;PID=9969#9969</guid>
  </item> 
  <item>
   <title>Predicate Builder Example : I have a question regarding your...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2486&amp;PID=9871#9871</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=945" rel="nofollow">mseeli</a><br /><strong>Subject:</strong> 2486<br /><strong>Posted:</strong> 04-Feb-2011 at 12:30am<br /><br />I have a question regarding your example in the documentation about using the Predicate Builder:<div>finding all Products with either of&nbsp;<span ="Apple-style-span" style="font-family: Helvetica, sans-serif; line-height: 20px; font-size: 14px; color: rgb77, 77, 77; ">“Sir Cajun Louisiana”</span></div><div><span ="Apple-style-span" style="font-family: Helvetica, sans-serif; line-height: 20px; font-size: 14px; "><br></span></div><div><span ="Apple-style-span" style="font-family: Helvetica, sans-serif; line-height: 20px; font-size: 14px; ">I would solve the problem as follows</span></div><div><span ="Apple-style-span" style="font-family: Helvetica, sans-serif; line-height: 20px; font-size: 14px; "><br></span></div><div><span ="Apple-style-span" style="font-size: 14px; line-height: 20px; "><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp;&nbsp;var _products = new ObservableCollection&lt;Product&gt;();</font></span></div><div><div><span ="Apple-style-span" style="font-size: 14px; line-height: 20px; "><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp;&nbsp;var db = NorthwindIBEntities.DefaultManager;</font></span></div><div><span ="Apple-style-span" style="font-family: 'Courier New', Courier, mono; line-height: 20px; font-size: 14px; ">&nbsp;&nbsp;var li = new List&lt;string&gt;();</span></div><div><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;"><font ="Apple-style-span" face="'Courier New', Courier, mono"><br></font></span></div><div><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;"><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp;&nbsp;li.Add("Sir");</font></span></div><div><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;"><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp;&nbsp;li.Add("Cajun");</font></span></div><div><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;"><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp;&nbsp;li.Add("Louisiana");</font></span></div><div><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;"><font ="Apple-style-span" face="'Courier New', Courier, mono"><br></font></span></div><div><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;"><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp;&nbsp;db.GetQuery&lt;Product&gt;().Where(x =&gt; li.Contains(x.ProductName)).ExecuteAsync(op =&gt;&nbsp;</font></span></div><div><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;"><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{foreach (var p in op.Results) _</font></span><span ="Apple-style-span" style="font-family: 'Courier New', Courier, mono; line-height: 20px; font-size: 14px; ">products.Add(p);} );</span></div></div><div><font ="Apple-style-span" color="#4D4D4D" face="Helvetica, sans-serif"><span ="Apple-style-span" style="font-size: 14px; line-height: 20px; "><br></span></font></div><div><font ="Apple-style-span" face="Helvetica, sans-serif"><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;">I understand that&nbsp;predicates&nbsp;can do a lot more than what is required in this simple example.&nbsp;</span></font></div><div><font ="Apple-style-span" face="Helvetica, sans-serif"><span ="Apple-style-span" style="font-size: 14px; line-height: 20px; ">My question is if there are important reasons not to solve this example in my way.</span></font></div><div><font ="Apple-style-span" face="Helvetica, sans-serif"><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;">Where does this query get executed (on the server or the client)?</span></font></div><div><font ="Apple-style-span" face="Helvetica, sans-serif"><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;"><br></span></font></div><div><font ="Apple-style-span" face="Helvetica, sans-serif"><span ="Apple-style-span" style="font-size: 14px; line-height: 20px;">Markus Seeli&nbsp;</span></font></div>]]>
   </description>
   <pubDate>Fri, 04 Feb 2011 00:30:38 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2486&amp;PID=9871#9871</guid>
  </item> 
 </channel>
</rss>