Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# sort array of objects by multiple properties

//asc order
List<Order> SortedList = objListOrder.OrderBy(o=>o.OrderDate).ThenBy(o=>o.ShipName).ToList();
// desc order
List<Order> SortedList = objListOrder.OrderByDescending(o=>o.OrderDate).ThenByDescending(o=>o.ShipName).ToList();
 
PREVIOUS NEXT
Tagged: #sort #array #objects #multiple #properties
ADD COMMENT
Topic
Name
4+4 =