Table of Contents

ThrowIfInvalidOptions Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Validator.cs

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

argument TOptions

The configured options to validate.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Type Parameters

TOptions

The 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

argument cannot be null.

ArgumentException

argument are not in a valid state.