IsNotNullOrEmpty

public static bool IsNotNullOrEmpty(this System.Collections.Generic.IEnumerable<T> source)
{
    return source != null && source.Any();
}
Example:
var list = new List<string>();
Assert.IsFalse( list.IsNotNullOrEmpty());


List<string> list = null;
Assert.IsFalse( list.IsFalseNullOrEmpty());

var list = new[] {"One, Two"};
Assert.IsTrue( list.IsNotNullOrEmpty());

Description

It returns false if given collection is null or empty otherwise it returns true.

Details

Double click on the code to select all.

 

;