<?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 : Queries with different sort order</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Queries with different sort order</description>
  <pubDate>Wed, 13 May 2026 11:30:20 -700</pubDate>
  <lastBuildDate>Mon, 23 Jan 2012 16:24:59 -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=3229</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>Queries with different sort order :  IEntityQuery&amp;lt;Zip&amp;gt;qryZi...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3229&amp;PID=12531#12531</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=957" rel="nofollow">hijaggu</a><br /><strong>Subject:</strong> 3229<br /><strong>Posted:</strong> 23-Jan-2012 at 4:24pm<br /><br /><br><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">&nbsp;&nbsp;<span style="color:#2b91af;">IEntityQuery</span>&lt;<span style="color:#2b91af;">Zip</span>&gt;&nbsp;qryZips&nbsp;=&nbsp;<span style="color:blue;">new</span>&nbsp;<span style="color:#2b91af;">EntityQuery</span>&lt;<span style="color:#2b91af;">Zip</span>&gt;&nbsp;()                             .Where&lt;<span style="color:#2b91af;">Zip</span>&gt;&nbsp;(&nbsp;p&nbsp;=&gt;&nbsp;p.State.StartsWith&nbsp;( "CA" )&nbsp;);<br><br>So all California zip codes are in cache now.<br><br>What would happen if I execute the same query with order by criteria while displaying them in grid on UI. <br><br>&nbsp;&nbsp; <span style="color:#2b91af;">CompositeSortSelector</span>&nbsp;OrderByCriterion&nbsp;=&nbsp;<span style="color:blue;">new</span>&nbsp;<span style="color:#2b91af;">SortSelector</span>&nbsp;(&nbsp;<span style="color:blue;">typeof</span>&nbsp;(&nbsp;<span style="color:#2b91af;">Zip</span>&nbsp;),&nbsp;<span style="color:#a31515;">"City"</span>,&nbsp;<span style="color:#2b91af;">ListSortDirection</span>.Ascending&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;&nbsp;.ThenBy&nbsp;(&nbsp;<span style="color:#a31515;">"Code"</span>,&nbsp;<span style="color:#2b91af;">ListSortDirection</span>.Ascending&nbsp;);<br><br><br><span style="color:#2b91af;">IEntityQuery</span>&lt;<span style="color:#2b91af;">Zip</span>&gt;&nbsp;qryZips&nbsp;=&nbsp;<span style="color:blue;">new</span>&nbsp;<span style="color:#2b91af;">EntityQuery</span>&lt;<span style="color:#2b91af;">Zip</span>&gt;&nbsp;()                             .Where&lt;<span style="color:#2b91af;">Zip</span>&gt;&nbsp;(&nbsp;p&nbsp;=&gt;&nbsp;p.State.StartsWith&nbsp;( "CA" )&nbsp;)<br>                           .OrderBySelector&lt;<span style="color:#2b91af;">Zip</span>&gt;&nbsp;(&nbsp;OrderByCriterion&nbsp;); Is it going to hit the database OR will pull the entities from cache and will apply necessary sort criterion? </pre>]]>
   </description>
   <pubDate>Mon, 23 Jan 2012 16:24:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3229&amp;PID=12531#12531</guid>
  </item> 
 </channel>
</rss>