Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
        public static bool IsEmpty <T>(this IEnumerable <T> source)
        {
            ArgumentMust.NotBeNull(() => source);

            return(EnumerablePredicates.IsEmpty(source));
        }