Possible duplicate:
Multiple "sort by" in LINQ
I want to order some dataset with some field AND THEN some other field.
Using lambda expressions would be easy (OrderBy.ThenBy), but how to do it when I have this syntax:
int maxQueries = int.MaxValue; // finds the most search for queries var ordered = from p in searchLogs where !string.IsNullOrEmpty(p.SearchQuery) group p by new { SearchQuery = p.SearchQuery } into pgroup let count = pgroup.Count() orderby count descending select new { Count = count, SearchQuery = pgroup.Key.SearchQuery };
I can't seem to find a way that works after the decending keyword (e.g. orderby count descending then searchquery).
Any ideas?
source share