Table of Contents

ThrowIfNull Method

Definition

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

ThrowIfNull<T>(IDecorator<T>, out T, string, string)

Validates and throws an ArgumentNullException if the specified argument is null.

public static void ThrowIfNull<T>(IDecorator<T> argument, out T inner, string message = "Value cannot be null.", string paramName = null)

Parameters

argument IDecorator<T>

The value to be evaluated.

inner T

The inner object of argument.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Type Parameters

T

The type of the inner object denoted by argument.

Exceptions

ArgumentNullException

argument cannot be null - or - Inner property of argument cannot be null.

ThrowIfNull(object, string, string)

Validates and throws an ArgumentNullException if the specified argument is null.

public static void ThrowIfNull(object argument, string message = "Value cannot be null.", string paramName = null)

Parameters

argument object

The value to be evaluated.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Exceptions

ArgumentNullException

argument cannot be null.