ThrowIfEnum Method
Definition
ThrowIfEnum<TEnum>(string, bool, string, string)
Validates and throws an ArgumentException if the specified argument represents an enumeration.
public static void ThrowIfEnum<TEnum>(string argument, bool ignoreCase = true, string message = "Value represents an enumeration.", string paramName = null) where TEnum : struct, IConvertible
Parameters
argumentstringThe value to be evaluated.
ignoreCasebooltrueto ignore case;falseto regard case.messagestringA message that describes the error.
paramNamestringThe name of the parameter that caused the exception.
Type Parameters
TEnumThe type of the enumeration.
Exceptions
- ArgumentException
argumentrepresents an enumeration.