I have a flagged enum and need to retrieve the names of all values set on it.
I am currently taking advantage of the enum\'s ToString() method which returns the eleme
Try this:
public void SetRoles(Enums.Roles role) { List result = new List(); foreach(Roles r in Enum.GetValues(typeof(Roles)) { if ((role & r) != 0) result.Add(r.ToString()); } }