Table of Contents

ThrowIfSequenceNullOrEmpty Method

Definition

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

ThrowIfSequenceNullOrEmpty<T>(IEnumerable<T>, string, string)

Validates and throws either an ArgumentNullException or ArgumentException if the specified argument is respectively null or has no elements.

public static void ThrowIfSequenceNullOrEmpty<T>(IEnumerable<T> argument, string message = "Value is either null or contains no elements.", string paramName = null)

Parameters

argument IEnumerable<T>

The value to be evaluated.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Type Parameters

T

Exceptions

ArgumentNullException

argument cannot be null.

ArgumentException

argument contains no elements.