ThrowIfInvalidOptions Method
Definition
ThrowIfInvalidOptions<TOptions>(TOptions, string, string)
Validates and throws an ArgumentException if the specified argument are not in a valid state.
public static void ThrowIfInvalidOptions<TOptions>(TOptions argument, string message = "{0} are not in a valid state.", string paramName = null) where TOptions : class, IParameterObject, new()
Parameters
argumentTOptionsThe configured options to validate.
messagestringA message that describes the error.
paramNamestringThe name of the parameter that caused the exception.
Type Parameters
TOptionsThe type of the object that potentially is implementing the IValidatableParameterObject interface.
Remarks
message will have the name of the TOptions if possible; otherwise Options.
Exceptions
- ArgumentNullException
argumentcannot be null.- ArgumentException
argumentare not in a valid state.