EnumerableExtensions.

IsNullOrEmpty<T>(IList<T>) Method

Summary

Checks whether specified IList is null or contains no elements

Syntax

public static bool IsNullOrEmpty<T>(this IList<T> source)

Examples

Replace
collection == null || collection.Count == 0
with
collection.IsNullOrEmpty()

Type Parameters

Name Description
T the item type

Parameters

Name Type Description
source IList<T> the collection

Return Value

Type Description
bool true if element null or empty, else false