This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, I'm working on a query which contains orderby elements.
This query works perfectly except it doesn't respect the specified order definition in the resulted List. I traced the SQL to verify, and the generated statement respects perfectly the order by.
Any idea ? Thanks in advance. Jonathan. |
|
|
Hi Jonathan, Is it ordered as per the grouping? e.g. PrixGranulat's with GranulatId of 1890 ordered first, followed by PrixGranulat's with a GranulatId of 1891 then 1893 etc?
|
|
|
Hi Jeremy, Yesssss it seems to be ordered per the grouping !
Is there a solution? Thanks in advance. Jonathan. |
|
|
Hi Jonathan, We order primarily based on the grouping result for grouping queries, within the grouping groups the results would be ordered as per the OrderBy clauses so if you want the final set to be ordered by your OrderBy clauses you would need to re-order it client side by enumerating the result set prior to your ordering. e.g. IQueryable
|
|
|
Hi, I tried your code but I got a compilation error:
Is there something I missed? Thanks in advance. Jonathan. |
|
|
Don't take in account my last post ... I forgot to specify the class type to the template ToList<>. So this code works:
Thanks. Jonathan |
|