New Posts New Posts RSS Feed: Queries with different sort order
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Queries with different sort order

 Post Reply Post Reply
Author
hijaggu View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Sep-2010
Posts: 21
Post Options Post Options   Quote hijaggu Quote  Post ReplyReply Direct Link To This Post Topic: Queries with different sort order
    Posted: 23-Jan-2012 at 4:24pm

  IEntityQuery<Zip> qryZips = new EntityQuery<Zip> ()
                             .Where<Zip> ( p => p.State.StartsWith ( "CA" ) );

So all California zip codes are in cache now.

What would happen if I execute the same query with order by criteria while displaying them in grid on UI.

   CompositeSortSelector OrderByCriterion = new SortSelector ( typeof ( Zip ), "City"ListSortDirection.Ascending )                                .ThenBy ( "Code"ListSortDirection.Ascending );


IEntityQuery<Zip> qryZips = new EntityQuery<Zip> () .Where<Zip> ( p => p.State.StartsWith ( "CA" ) )
.OrderBySelector<Zip> ( OrderByCriterion ); Is it going to hit the database OR will pull the entities from cache and will apply necessary sort criterion?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down