Suppose you have a collection and inside that collection you have a child collection. Here is a example of such relation
Here you can see Reminder is a nested collection inside Vahicle. You can have a collection of Vahicles and you may want to display Vahicles shorting by ReminderType.
To solve this problem I have converted the collection to flat list where there have a property ReminderType so that when I do order by using ReminderType. The total collection will be sorted. SelectMany convert nested collection to flat collection. So I used SelectMany(). to make a flat collection with ReminderType.
Here is the code Line 1-2 I converted Vahicle nested Collection into a collection where Vahicle collection is a property and also ReminderType is a property using SelectMany(). After Converting the collection I have done orderby with ReminderType and vahicle is also sorted Line 3. As I only need sorted Vahicle collection so I selected only Vahicle property from anonymous object Line 4.
Problem could be more complex where you may need to select object based on certain criteria and also collection can be nested 3-4 levels or more. You can do another SelectMany if there have another nested collection.