Tell me more ×  Which is the currently-accepted best practice in
terms of C# enum usage, a bitwise [Flags] Enum (compared using |
and &) or an IEnumerable of enum values? I'm thinking both from
a code-conciseness perspective and from a maintenance
perspective.  The only downside to using the Flags approach that
I can think of is the inability to enumerate the values without
doing the reverse enumeration:  var possibleValues =
Enum.GetValues(typeof(MyEnum)).Cast<MyEnum>(); var
applicableValues = possibleValues.Where(x =>
(containerClass.EnumProperty & x) == x);  Whereas obviously the
IEnumerable is easier to query.   As svick rightly pointed out,
the IEnumerable would be perhaps the wrong collection to use, an
ISet might be a better example.  share|improve this question
What would be the purpose of an IEnumerable of enum values? What
do you intend to use the Enum for? –  Oded Dec 20 '11 at 11:58
To hold a collection of attributes about the container class
(the concrete example being attributes about a product,