I have a IEnumerable<Process>
.
public class Process
{
public string Id { get; set; }
public string Name { get; set; }
public int Type { get; set; }
}
I want to order this IEnumerable<Process>
based on Type
. The ordering should be based on a predefined sequence.
The sequence is: 7,3,4,1. So, if the collection has any of these values they should appear in the order first 7, then 3 etc.
Any other Type
then on should be in ascending order.
What is the correct way to order this based on a predefined sequence? Should I define the sequence itself as a enum
?