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

            return(EnumerablePredicates.IsEmpty(source));
        }