ThrowIfContainsReservedKeyword Method
Definition
ThrowIfContainsReservedKeyword(string, IEnumerable<string>, string, string)
Validates and throws a ArgumentReservedKeywordException if the specified argument is found in the sequence of reservedKeywords.
public static void ThrowIfContainsReservedKeyword(string argument, IEnumerable<string> reservedKeywords, string message = null, string paramName = null)
Parameters
argumentstringThe keyword to compare with
reservedKeywords.reservedKeywordsIEnumerable<string>The reserved keywords to compare with
argument.messagestringA message that describes the error.
paramNamestringThe name of the parameter that caused the exception.
Exceptions
- ArgumentReservedKeywordException
The specified
argumentis contained withinreservedKeywords.
ThrowIfContainsReservedKeyword(string, IEnumerable<string>, IEqualityComparer<string>, string, string)
Validates and throws a ArgumentReservedKeywordException if the specified argument is found in the sequence of reservedKeywords.
public static void ThrowIfContainsReservedKeyword(string argument, IEnumerable<string> reservedKeywords, IEqualityComparer<string> comparer, string message = null, string paramName = null)
Parameters
argumentstringThe keyword to compare with
reservedKeywords.reservedKeywordsIEnumerable<string>The reserved keywords to compare with
argument.comparerIEqualityComparer<string>The IEqualityComparer<T> implementation to use when comparing
reservedKeywordswithargument.messagestringA message that describes the error.
paramNamestringThe name of the parameter that caused the exception.
Exceptions
- ArgumentReservedKeywordException
The specified
argumentis contained withinreservedKeywords.