Similar Topics...
|
LINQ - Order by multiple fields Ordering a list in LINQ can be done with OrderBy: myList = myList.OrderBy(p => p.Value1).ToList(); But to order multiple fields, you need to use 'ThenBy' for each additional field: myList = myList.OrderBy(p => p.Value1).ThenBy(p => p.Value2).ToList();
Created By: amos 10/25/2007 11:36:27 AM
|
|
|
|
|
|