I need to sort a list, by X and Y. I read some on other questions to sort X and Y, but I didn't understand the:
List<SomeClass>() a; List<SomeClass> b = a.OrderBy(x => x.x).ThenBy(x => x.y).ToList(); I mean, x => x.x gives undeclared variable error.
Question is: How to sort by X and Y in a list, or: What variable to have instead of x => x.x????
edit: right, my list is like this:
List<Class1> MapTiles; and in class: int ID, int X, int Y
Thanx.
List<SomeClass>() a;will not compile. WriteList<SomeClass> a = new List<SomeClass>();. Or, identical (but less noisy) code:var a = new List<SomeClass>();