Below is my Enumerator List
:
public enum StatusEnum
{
Open = 1,
Rejected = 2,
Accepted = 3,
Started = 4,
Completed = 5,
Canc
return Enum.GetValues(typeof(Activity.StatusEnum)).Cast().Where((n, x) => x < 4);
If you want to be able to change the list of items, just add them into a List
and use Contains
:
var listValid = new List() { Activity.StatusEnum.Open, Activity.StatusEnum.Rejected, Activity.StatusEnum.Accepted, Activity.StatusEnum.Started };
return Enum.GetValues(typeof(Activity.StatusEnum)).Cast().Where(n => listValid.Contains(n));