I’ve noticed I’ve been doing this inconsistently within the same project. In some places, I’ll have an enum with an ALL option, and in others I’ll have my enum as a nullable type with a null value indicating all (or no filter.)
I noticed it when I had to write something like if (Region != null && Region != Regions.ALL).
Is there a reason to go one way or the other?
Where Enums that you need to specify either an “All” or “Null” type, I usually go with the
Flagattribute and use bitwise&and|. That is a much more flexible solution.As for making a nullable type or having one option be “All”, I think if it makes sense to you, then I see no problem with it. I just prefer using Flags.