Below is my Enumerator List:
public enum StatusEnum
{
Open = 1,
Rejected = 2,
Accepted = 3,
Started = 4,
Completed = 5,
Canc
Steps:
enum values and cast the results to the type of the enumenum values by their integer values (otherwise they sort
naturally by unsigned magnitude)Code:
return Enum.GetValues(typeof(Activity.StatusEnum))
.Cast()
.OrderBy(se =>(int)se)
.Take(4);
Output:
Open Rejected Accepted Started