Are you sure it matters? Wouldn't the database ignore the order by as an optimization?
/Oskar 2012/5/23 Felipe Oriani <[email protected]>: > > 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 LinkedIn Facebook > 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 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. -- You received this message because you are subscribed to the Google Groups "nhusers" group. 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.
