Table of Contents

ThrowIfSequenceEmpty Method

Definition

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

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

Validates and throws an ArgumentException if the specified argument has no elements.

public static void ThrowIfSequenceEmpty<T>(IEnumerable<T> argument, string message = "Value 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

Remarks

This method will not throw an exception if argument is null.

Exceptions

ArgumentException

argument contains no elements.