I’ve 3 columns that I’d like to sort in the Excel way, i.e. sorting the first column, and for each element sorted in the first column, I’ll sort the second column, and so on. Let’s say I first sort alphabetically Countries, then for each country, I sort alphabetically cities. How do I do it using Linq2Sql?
Share
You can string together a bunch of sorts.
You need to use
OrderByandThenBy.You can keep chaining them together to get deferred sorting until you do the
ToList.Using query syntax: