public static void NotBeEmpty <T>(Func <IEnumerable <T> > argumentFunc) { if (EnumerablePredicates.IsEmpty(argumentFunc())) { var argument = argumentFunc.GetParameter(EnumerablePredicates.IsEmpty); throw new ArgumentException($"The sequence '{argument.Name}' must not be empty.", argument.Name); } }
public static bool IsEmpty <T>(this IEnumerable <T> source) { ArgumentMust.NotBeNull(() => source); return(EnumerablePredicates.IsEmpty(source)); }