ThrowIfInvalidConfigurator Method
Definition
ThrowIfInvalidConfigurator<TOptions>(Action<TOptions>, out TOptions, string, string)
Validates and throws an ArgumentException if the specified argument results in an instance of invalid options.
public static void ThrowIfInvalidConfigurator<TOptions>(Action<TOptions> argument, out TOptions options, string message = "Delegate must configure the public read-write properties to be in a valid state.", string paramName = null) where TOptions : class, IParameterObject, new()
Parameters
argumentAction<TOptions>The delegate that will configure the public read-write properties of
options.optionsTOptionsThe default parameter-less constructed instance of
TOptionsconfigured withargumentdelegate.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.
Exceptions
- ArgumentException
argumentfailed to configure an instanceoptionsin a valid state.