<?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 : Or between Where operators</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Or between Where operators</description>
  <pubDate>Sat, 11 Apr 2026 17:54:09 -700</pubDate>
  <lastBuildDate>Thu, 21 Oct 2010 03:32:05 -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=2237</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>Or between Where operators : Thanx again sbelini! This PredicateBuilder...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8869#8869</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=946" rel="nofollow">danjal</a><br /><strong>Subject:</strong> 2237<br /><strong>Posted:</strong> 21-Oct-2010 at 3:32am<br /><br /><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>Thanx again sbelini!<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>This PredicateBuilder is excellent!<o:p></o:p></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>This is exactly what I was looking for!<o:p></o:p></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>Here is what my query ends up looking like:<o:p></o:p></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> predicate = <SPAN style="COLOR: #2b91af">PredicateBuilder</SPAN>.True&lt;<SPAN style="COLOR: #2b91af">EntTs</SPAN>&gt;();<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> strings = param.p_text.Split(<SPAN style="COLOR: #a31515">','</SPAN>);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>foreach</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> (<SPAN style="COLOR: blue">string</SPAN> s <SPAN style="COLOR: blue">in</SPAN> strings)<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>{<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; TEXT-INDENT: 35.4pt; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> intervals = s.Split(<SPAN style="COLOR: #a31515">'-'</SPAN>);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>predicate = predicate.Or(ts =&gt; ts.p_tsID &gt;= <SPAN style="COLOR: #2b91af">Int32</SPAN>.Parse(intervals&#091;0&#093;.Trim()) &amp;&amp; ts.p_tsID &lt;= <SPAN style="COLOR: #2b91af">Int32</SPAN>.Parse(intervals&#091;1&#093;.Trim()));<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>}<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> query = p_manager.EntTsSet.Where(predicate);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>query = query.OrderBy(ts =&gt; ts.p_tsID);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Query(query,callback);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>And if I use the help from my JetBrains Reshaper, it ends up looking like this:<o:p></o:p></FONT></FONT></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> predicate = <SPAN style="COLOR: #2b91af">PredicateBuilder</SPAN>.True&lt;<SPAN style="COLOR: #2b91af">EntTs</SPAN>&gt;();<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> strings = param.p_text.Split(<SPAN style="COLOR: #a31515">','</SPAN>);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>predicate = strings.Select(s =&gt; s.Split(<SPAN style="COLOR: #a31515">'-'</SPAN>)).Aggregate(predicate, (current, intervals) =&gt; current.Or(ts =&gt; ts.p_tsID &gt;= <SPAN style="COLOR: #2b91af">Int32</SPAN>.Parse(intervals&#091;0&#093;.Trim()) &amp;&amp; ts.p_tsID &lt;= <SPAN style="COLOR: #2b91af">Int32</SPAN>.Parse(intervals&#091;1&#093;.Trim())));<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> query = p_manager.EntTsSet.Where(predicate);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>query = query.OrderBy(ts =&gt; ts.p_tsID);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Query(query,callback);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>Just love it!<o:p></o:p></FONT></FONT></SPAN></P>]]>
   </description>
   <pubDate>Thu, 21 Oct 2010 03:32:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8869#8869</guid>
  </item> 
  <item>
   <title>Or between Where operators : The PredicateBuilder will also...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8857#8857</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> 2237<br /><strong>Posted:</strong> 20-Oct-2010 at 11:28am<br /><br />The PredicateBuilder will also help you in the task you are working on now (the snippet below might help you get started): <DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&nbsp;</DIV><DIV><DIV></FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>&nbsp; List</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>CompositePredicateDescription</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt; CompPredDescs = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>List</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>CompositePredicateDescription</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;();</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp; </FONT>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> strings = param.Split(</FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>','</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>);</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&nbsp;</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp; </FONT>foreach</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>string</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> s </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>in</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> strings) {</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> intervals = s.Split(</FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>'-'</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>);</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> expr1 = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>PredicateBuilder</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Make(</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>typeof</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>(</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Employee</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>), </FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"EmployeeID"</DIV><DIV></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>, </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>FilterOperator</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.IsGreaterThanOrEqualTo</DIV><DIV><FONT color=#2b91af>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>, </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Int32</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Parse(intervals&#091;0&#093;.Trim()));</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> expr2 = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>PredicateBuilder</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Make(</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>typeof</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>(</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Employee</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>), </FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"EmployeeID"</DIV><DIV></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>, </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>FilterOperator</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.IsLessThanOrEqualTo</DIV><DIV><FONT color=#2b91af>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>, </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Int32</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Parse(intervals&#091;1&#093;.Trim()));</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> expr12 = expr1.And(expr2);</DIV><DIV><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>CompPredDescs.Add(expr12);</DIV><DIV><FONT color=#2b91af>&nbsp; </FONT>}</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp; </FONT>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (CompPredDescs.Count &gt; 0) {</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> expr = CompPredDescs&#091;0&#093;;</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>for</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>int</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> i = 1; i &lt; CompPredDescs.Count; i++) {</DIV><DIV><FONT color=#2b91af>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>expr = expr.Or(CompPredDescs);</DIV><DIV><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>}</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp; &nbsp; </FONT>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> exprFunc = (</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Expression</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Func</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Employee</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>, </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>bool</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;&gt;)expr.ToLambdaExpression();</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> query = mgr.Employees.Where(exprFunc);</DIV><DIV></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#2b91af>&nbsp;&nbsp;&nbsp; </FONT>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> results = query.Execute();</DIV><DIV><FONT color=#2b91af>&nbsp; </FONT>}</DIV><DIV>}</DIV><DIV></FONT></FONT></FONT></FONT></DIV></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>I hope it helps</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by sbelini - 20-Oct-2010 at 11:29am</span>]]>
   </description>
   <pubDate>Wed, 20 Oct 2010 11:28:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8857#8857</guid>
  </item> 
  <item>
   <title>Or between Where operators : Thanx sbelini!  Looks interesting!...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8854#8854</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=946" rel="nofollow">danjal</a><br /><strong>Subject:</strong> 2237<br /><strong>Posted:</strong> 20-Oct-2010 at 9:54am<br /><br /><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Thanx sbelini!<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Looks interesting! I will look into this.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Here is what I am working on at the moment:<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>The user can search for some items by typing some intervals of ids in a search dialog.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>The user would for example type this: 10-20,40-45,100-110<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Meaning that the user wants to see the items whose ids range from 10 to 20 and 40 to 45 and 100 to 110.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>I would make my query dynamically like this, because I do not know how many intervals the user is going to type into the search dialog:<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: #2b91af; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>IQueryable</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>&lt;<SPAN style="COLOR: #2b91af">EntTs</SPAN>&gt; query = p_manager.EntTsSet;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> strings = param.Split(<SPAN style="COLOR: #a31515">','</SPAN>);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>foreach</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> (<SPAN style="COLOR: blue">string</SPAN> s <SPAN style="COLOR: blue">in</SPAN> strings)<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>{<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; TEXT-INDENT: 35.4pt; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> intervals = s.Split(<SPAN style="COLOR: #a31515">'-'</SPAN>);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; query = query.Where(ts =&gt; ts.p_tsID &gt;= <SPAN style="COLOR: #2b91af">Int32</SPAN>.Parse(intervals&#091;0&#093;.Trim()) &amp;&amp; ts.p_tsID &lt;= <SPAN style="COLOR: #2b91af">Int32</SPAN>.Parse(intervals&#091;1&#093;.Trim()));<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>}<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>query = query.OrderBy(ts =&gt; ts.p_tsID);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Query((<SPAN style="COLOR: #2b91af">IEntityQuery</SPAN>&lt;<SPAN style="COLOR: #2b91af">EntTs</SPAN>&gt;) query, callback);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>But this does not work because this returns only 100 to 110. But if the Where operators had an Or between them I would get the union, which is that I want.<o:p></o:p></SPAN></P>]]>
   </description>
   <pubDate>Wed, 20 Oct 2010 09:54:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8854#8854</guid>
  </item> 
  <item>
   <title>Or between Where operators : In this case you can use PredicateDescription:  ...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8853#8853</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> 2237<br /><strong>Posted:</strong> 20-Oct-2010 at 9:37am<br /><br />In this case you can use PredicateDescription:<DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">var</SPAN> expr1 = PredicateBuilder.Make(<SPAN style="COLOR: #0000ff">typeof</SPAN>(EntsSet), <SPAN style="COLOR: #800000">"p_tsID"</SPAN>, FilterOperator.IsEqualTo, 10<FONT color=#000000>);</FONT></DIV><DIV>&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">var</SPAN> expr2 = PredicateBuilder.Make(<SPAN style="COLOR: #0000ff">typeof</SPAN>(EntsSet), <SPAN style="COLOR: #800000">"p_tsID"</SPAN>, FilterOperator.IsEqualTo, 20);<BR>&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">var</SPAN> expr1_2 = expr1.Or(expr2);<BR><SPAN style="COLOR: #0000ff">&nbsp;&nbsp; var</SPAN> query = PredicateBuilder.FilterQuery(em.EntsSet, expr1_2);</DIV><DIV>&nbsp;</DIV><DIV>You can find detailed information about PredicateDescription in our <a href="http://drc.ideablade.com/Api&#068;ocumentati&#111;n/" target="_blank">DevForce API Documentation</A>.<BR></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 20 Oct 2010 09:37:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8853#8853</guid>
  </item> 
  <item>
   <title>Or between Where operators : Sbelini,  I know. But whatI...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8845#8845</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=946" rel="nofollow">danjal</a><br /><strong>Subject:</strong> 2237<br /><strong>Posted:</strong> 20-Oct-2010 at 2:02am<br /><br /><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>Sbelini,<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>I know. But what&nbsp;I want, is to build my query dynamically – something like this:<o:p></o:p></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> query = p_manager.EntTsSet;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>if</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> (<SPAN style="COLOR: red">Something</SPAN>)<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; TEXT-INDENT: 35.4pt; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>query = query.Where(ts =&gt; ts.p_tsID == 10);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>if</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> (<SPAN style="COLOR: red">SomethingElse</SPAN>)<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; TEXT-INDENT: 35.4pt; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>query = query.Where(ts =&gt; ts.p_tsID == 20);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>query = query.OrderBy(ts =&gt; ts.p_tsID);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Query((<SPAN style="COLOR: #2b91af">IEntityQuery</SPAN>&lt;<SPAN style="COLOR: #2b91af">EntTs</SPAN>&gt;)query, callback);<o:p></o:p></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>This is just a simple example. I want to be able to construct more complex queries dynamically, based on that a user enters in a search dialog. <o:p></o:p></FONT></FONT></SPAN></P>]]>
   </description>
   <pubDate>Wed, 20 Oct 2010 02:02:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8845#8845</guid>
  </item> 
  <item>
   <title>Or between Where operators : danjal,  The second Where is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8823#8823</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> 2237<br /><strong>Posted:</strong> 19-Oct-2010 at 10:23am<br /><br />danjal,<DIV>&nbsp;</DIV><DIV>The second Where is filtering the result set of the first Where (just like AND, but not actually AND).</DIV><DIV>&nbsp;</DIV><DIV>You will need both statements within one Where:</DIV><DIV>&nbsp;</DIV><DIV><DIV><DIV></DIV><DIV></DIV><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> query = p_manager.EntTsSet<?: PREFIX = O /><O:P></O:P></SPAN></DIV><P style="LINE-HEIGHT: normal; TEXT-INDENT: 35.4pt; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>.Where(ts =&gt; ts.p_tsID == 10</P><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;||</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> ts.p_tsID == 20);<O:P></O:P></SPAN></DIV><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Query((<SPAN style="COLOR: #2b91af">IEntityQuery</SPAN>&lt;<SPAN style="COLOR: #2b91af">EntTs</SPAN>&gt;)query, callback);</P><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"></SPAN>&nbsp;</P></DIV>]]>
   </description>
   <pubDate>Tue, 19 Oct 2010 10:23:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8823#8823</guid>
  </item> 
  <item>
   <title>Or between Where operators : If I would run a query like this:...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8819#8819</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=946" rel="nofollow">danjal</a><br /><strong>Subject:</strong> 2237<br /><strong>Posted:</strong> 19-Oct-2010 at 9:18am<br /><br /><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>If I would run a query like this: </P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></SPAN></P><DIV><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US></SPAN>&nbsp;</DIV><DIV><SPAN style="FONT-FAMILY: C&#111;nsolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>var</SPAN><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US> query = p_manager.EntTsSet<o:p></o:p></SPAN></DIV><P style="LINE-HEIGHT: normal; TEXT-INDENT: 35.4pt; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>.Where(ts =&gt; ts.p_tsID == 10)<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>.Where(ts =&gt; ts.p_tsID == 20);<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: n&#111;ne" =Ms&#111;normal><SPAN style="FONT-FAMILY: C&#111;nsolas; FONT-SIZE: 9.5pt; mso-ansi-: EN-US" lang=EN-US>Query((<SPAN style="COLOR: #2b91af">IEntityQuery</SPAN>&lt;<SPAN style="COLOR: #2b91af">EntTs</SPAN>&gt;)query, callback);<o:p></o:p></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>it would return empty because there is an <strong>AND</strong> between the two <strong>Where</strong> operators – so an ID cannot be 10 and 20 at the same time.</P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><o:p></o:p></FONT></FONT></SPAN></P><DIV><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri></FONT></FONT></SPAN>&nbsp;</DIV><DIV><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>But what if I want an <strong>OR</strong> between the two <strong>Where</strong> operators?<o:p></o:p></FONT></FONT></SPAN></DIV><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>Can I make my own <strong>OrWhere</strong> operator?<o:p></o:p></FONT></FONT></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" =Ms&#111;normal><SPAN style="mso-ansi-: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>And does anyone know how to do that?<o:p></o:p></FONT></FONT></SPAN></P>]]>
   </description>
   <pubDate>Tue, 19 Oct 2010 09:18:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2237&amp;PID=8819#8819</guid>
  </item> 
 </channel>
</rss>