How to sort on the Value of an member of a List within a parent List?

Well List x. Value) but even Sort isn't too bad: lmo. Sort((x, y) => x.Value.

CompareTo(y. Value)) EDIT: Having read the comment to the question, I no longer understand the question! Leaving this answer here as a potentially useful placeholder while I have dinner.

Well, List already has a Sort method if you want to sort it in place - or you could use LINQ's OrderBy method. OrderBy is slightly easier than Sort: var sorted = lmo. OrderBy(x => x.

Value); but even Sort isn't too bad: lmo. Sort((x, y) => x.Value. CompareTo(y.

Value)); EDIT: Having read the comment to the question, I no longer understand the question! Leaving this answer here as a potentially useful placeholder while I have dinner...

Int MyObjectComparison(MyObject x, MyObject y) { return x. Setting0.Value. CompareTo(y.

Setting0. Value); } lmo. Sort(MyObjectComparison); Of course, this assumes that you want to use the Value of the first element in setting (and that setting is guarunteed to have at least one element).

Solution with less assumption will be forthcoming when more info is given.

Since you are using 3.0, use LINQ: var newList = lmo. OrderBy(i => i. Value); and var newList = lmo.

OrderByDescending(i => i. Value).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions