ThrowIfGuid Method
Definition
ThrowIfGuid(string, GuidFormats, string, string)
Validates and throws an ArgumentException if the specified argument has the format of a Guid.
public static void ThrowIfGuid(string argument, GuidFormats format = GuidFormats.D | GuidFormats.B | GuidFormats.P, string message = "Value cannot be a Guid.", string paramName = null)
Parameters
argumentstringThe value to be evaluated.
formatGuidFormatsA bitmask comprised of one or more GuidFormats that specify how the GUID parsing is conducted.
messagestringA message that describes the error.
paramNamestringThe name of the parameter that caused the exception.
Exceptions
- ArgumentException
argumentcannot be a Guid.