what does the actual query look like? I bet if you look at the execution 
plan that the query compiler is ignoring the order by so it probably 
doesn't matter if you have it or not.

On Tuesday, May 22, 2012 7:09:34 PM UTC-6, Felipe Oriani wrote:
>
>
> Hello Guys, I have an extension method for my queries to page it, this is 
> the code:
>
>         public static PagedList<T> ToPageList<T>(this IQueryOver<T, T> 
> query, int size, int index)
>         {
>             int total = query.Clone().FutureRowCount();
>             var list = query.Take(size).tSkip((index - 
> 1)*size).Future<T>();
>             
>             return new PagedList<T>(list, total, size, index);
>         }
>
> It works fine, but when I use an order by method (on my queryover), the 
> Nhibernate process this order by command on the count query. 
> My question is, is there any way to remove the order by from the QueryOver 
> to NHibernate count it without order by?
>
> Or if anyone has any suggestions to improve this method, I would 
> appreciate.
>
> PS: I use it with asp.net mvc
>
> Thank you!
>
>
> -- 
> ______________________________________
> Felipe B. Oriani
> felipeoriani.com.br [email protected] 
> @felipeoriani<http://www.twitter.com/felipeoriani>
>  LinkedIn <http://br.linkedin.com/in/felipeoriani> 
> Facebook<http://www.facebook.com/felipeoriani>
> Contato: (19) 9611-8646 / (19) 3421-7850
>
> "...Trabalhe quanto puder, tornando-se útil quanto possível..." , por 
> André Luiz
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/KLUdZtHIpZoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to