You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ardalis, I am wondering what your thoughts are regarding the idea of having the option of specifying a default enum value for a class inheriting from SmartEnum.
An exception gets thrown. Instead, I would prefer to have the Other status returned if an unknown is specified in the FromName method. How would you recommend solving this? Would there be any benefit to adding a new constructor to SmartEnum that allows an enum to specify whether it is to be used as a default value?
The text was updated successfully, but these errors were encountered:
@ardalis, I am wondering what your thoughts are regarding the idea of having the option of specifying a default enum value for a class inheriting from SmartEnum.
For example, let's say I have the following enum:
Then, if I were to do this:
An exception gets thrown. Instead, I would prefer to have the
Other
status returned if an unknown is specified in theFromName
method. How would you recommend solving this? Would there be any benefit to adding a new constructor toSmartEnum
that allows an enum to specify whether it is to be used as a default value?The text was updated successfully, but these errors were encountered: