ThrowIfNotEmailAddress Method
Definition
ThrowIfNotEmailAddress(string, string, string)
Validates and throws an ArgumentException if the specified argument does not have the format of an email address.
public static void ThrowIfNotEmailAddress(string argument, string message = "Value must be an email address.", string paramName = null)
Parameters
argumentstringThe value to be evaluated.
messagestringA message that describes the error.
paramNamestringThe name of the parameter that caused the exception.
Exceptions
- ArgumentException
argumentmust be an email address.