How is the OrderByDescending used ?
I have a label, Circles, declared like this
ReadOnlyCollection<FlangeCircle> Circles
which contain a variabel, Diameter of the type double
I want to sort them based on the diamter so I try
FlangeCircle<FlangeCircle> query = Circles.OrderByDescending(p => p.Diameter);
but that will not go throug the compiler, but the following does
var query = Circles.OrderByDescending(p => p.Diameter);
Why is that and how do I declare query with a “correct” type instead ?
/Stefan
The type of the variable is the problem:
FlangeCircle<FlangeCircle>doesn’t make sense as a type, and certainly isn’t what’s returned byOrderByDescending. You almost certainly want:Or if you want to be able to perform
ThenBy/ThenByDescendingoperatorions onquery: