Summary
Throws an System.ArgumentNullException
if the argument is null or empty.
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
Parameters
Name |
Type |
Description |
argument |
IEnumerable<T> |
Argument value. |
nameOfArgument |
string |
Name of the argument. |
Return Value
Type |
Description |
IEnumerable<T> |
|