Answer the question
In order to leave comments, you need to log in
How to make multiple sorts in one class?
Actually, subject. How to implement sorting in a class by several fields to choose from. For example, sorting by name, by age, etc.
Answer the question
In order to leave comments, you need to log in
var orderedUsers = users.OrderBy(o => o.Name).ThenBy(o => o.Age);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question