IsNullOrEmpty

/// <summary>
/// Determines whether the given IList object [is null or empty].
/// </summary>
/// <param name="obj">The object.</param>
/// <returns><c>true</c> if the given IList object [is null or empty]; otherwise, <c>false</c>.</returns>
public static bool IsNullOrEmpty(this IList obj)
{
    return obj == null || obj.Count == 0;
}
Example:
List<string> countryList = null;
if (countryList.IsNullOrEmpty())
{ 

}
else
{ 

}

var cityList = new List<string> { "NewYork", "London" };
if (cityList.IsNullOrEmpty())
{

}
else
{

}

Description

Check either IList object is null or empty.

Details

Double click on the code to select all.