ArgumentEnumerableGuard.

ThrowIfIsNullOrEmpty<T>(IEnumerable<T>, string) Method

Summary

Throws an System.ArgumentNullException if the argument is null or empty.
Namespace
oehen.arguard
Containing Type
ArgumentEnumerableGuard

Syntax

public static IEnumerable<T> ThrowIfIsNullOrEmpty<T>(this IEnumerable<T> argument, string nameOfArgument)

Examples

How to validate argument `enumerableArgument`.

var localVar = enumerableArgument.ThrowIfIsNullOrEmpty(nameof(enumerableArgument));

Type Parameters

Name Description
T

Parameters

Name Type Description
argument IEnumerable<T> Argument value.
nameOfArgument string Name of the argument.

Return Value

Type Description
IEnumerable<T>
GitHub