If I have a class with an enum member, and I want to be able to represent situations where this member is not defied, which is it better:
A) Declare the member as nullable in the class using nullable types. E.g.:
public SomeEnum? myEnum;
B) Add a default, 'unknown' value to the enumeration. E.g.:
public enum SomeEnum {
Unknown,
SomeValueA,
SomeValueB,
SomeValueC,
}
I can't really see any major pros/cons either way. But perhaps one is preferrable over the other?