I haven't figured out the problem exactly, but the following test fails fof me on VS2010, .net 4.0:
public void SortFirstAscendingSecondDescendingThirdAscending()
Random random = new Random(3);
var data = new Triple;
for (int index = 0; index < data.Length; index++)
data[index] = new Triple(random.Next(100), random.Next(100), random.Next(100));
var sorted1 = data.OrderBy(x => x.First).ThenByDescending(x => x.Second).ThenBy(x => x.Third);
var sorted2 = data.LazyOrderBy(x => x.First).ThenByDescending(x => x.Second).ThenBy(x => x.Third);
I think the problem is in ElementComparer.Append, though I'm not sure how it should be fixed.
Chain multiple ThenBy operators correctly. Fixes #17.
You were correct: ElementComparer.Append was implemented incorrectly. If multiple ThenBy operators were chained, it would drop the initial OrderBy comparison.