I have that class
public class MyItem
{
public Order OrderItem { get; set; }
public string Status { get; set; }
}
the Status property can have values Error, Pending, Success
I want to sort the List<MyItem>() object basing on the Status property.
I know that I can replace the type of the Status property from string to int and then instead of Error, Pending, Success values I can have 1,2,3 and then the sort operation is simple. But I'm wondering how to do it if we must do the sorting on basing on the string type property.
Possible order:
Error, Pending, Success or Success, Pending, Error
how to do it by using LINQ ?
IComparer<string>but, like @PLB says, why not use an enum?