Table of Contents

ThrowIfInvalidConfigurator Method

Definition

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

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

argument Action<TOptions>

The delegate that will configure the public read-write properties of options.

options TOptions

The default parameter-less constructed instance of TOptions configured with argument delegate.

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.

Exceptions

ArgumentException

argument failed to configure an instance options in a valid state.