score:15

Accepted answer

You don't assign result of OrderByDescending

leaves = leaves.OrderByDescending(e => e.StartDate).ToList();

or do

leaves = leaves.Concat(otherleaves).OrderByDescending(e => e.StartDate).ToList();

score:0

OrderByDescending

doesn't order a list, it returns a new ordered IEnumerable. So use the result of OrderByDescending to display your items.

score:1

OrderByDescending does not "sort in place". It rather returns an IOrderedEnumerable that you must assign to a variable.

var orderedLeaves = leaves.OrderByDescending(e => e.StartDate);

Related Articles