In LINQ to SQL, does Select after OrderBy preserve the ordering?
And what if I want to call ThenBy after the Select? Can I just cast to IOrderedQueryable? Or is there a better method?
5 Replies
You can call method that returns sql query in string format and check it
ToQueryString()
@blueberriesiftheywerecats meaning it's not guaranteed?
I mean, I don't really know answer to your question, but if you know sql you can check it yourself
(I think it will preserve ordering)
Ok, thank you
Select will just change the
select
statement in sql query, so it doesn't matter whether you call it after or before sorting
afaik