I have a list of items in a SharePoint which has Title, Date and Priority. I would like to sort this collection on my client application while displaying it ,sorting need to first by Date Descending and then within a set of objects for a date, it should sort objects by Priority.
I am using below LINQ code, which is not providing the expected result. Means the below code not sorting object by priority with in a date.
var results = spObjects.OrderByDescending(n => n.Date).ThenBy(t => t.Priority);
Unsorted collection is as below
Sorted Collection - Expectation
I am using SharePoint CAML query, since I am fetching these object from SP and I found it difficult to do it in CAML, but I assume this can be done using LINQ on C# side, Isnt it ? Could anyone please help ?