public static string UnrecognizedEnumerationValueMessage(Type enumerationType, string unrecognizedValue) { var enumerationTypeFullName = enumerationType.FullName; var output = EnumerationHelper.UnrecognizedEnumerationValueMessage(enumerationTypeFullName, unrecognizedValue); return(output); }
/// <summary> /// Gets a message indicating that the input string representation of an enumeration value was not recognized among the string representations of a possible values of the <typeparamref name="TEnum"/> enumeration. /// </summary> public static string UnrecognizedEnumerationValueMessage <TEnum>(string unrecognizedValue) where TEnum : Enum // Requires C# 7.3. { var enumerationType = typeof(TEnum); var output = EnumerationHelper.UnrecognizedEnumerationValueMessage(enumerationType, unrecognizedValue); return(output); }
public static UnrecognizedEnumerationValueException From <T>(string unrecognizedValue) where T : Enum { var message = EnumerationHelper.UnrecognizedEnumerationValueMessage <T>(unrecognizedValue); var exception = UnrecognizedEnumerationValueException.From <T>(unrecognizedValue, message); return(exception); }
public UnrecognizedEnumerationValueException(string enumerationTypeFullName, string unrecognizedValue) : this(EnumerationHelper.UnrecognizedEnumerationValueMessage(enumerationTypeFullName, unrecognizedValue)) { this.EnumerationTypeFullName = enumerationTypeFullName; this.UnrecognizedValue = unrecognizedValue; }