Exemple #1
0
        public static IValidationContext <IEnumerable <T> > IsNotEmptyEnumerable <T>(this IValidationContext <IEnumerable <T> > context)
        {
            context.IsNotNull();

            if (!context.Value.Any())
            {
                throw new ArgumentException("Enumeration contains no elements", context.ParameterName);
            }

            return(context);
        }
Exemple #2
0
 public static IValidationContext <string> IsNotNullOrEmpty(this IValidationContext <string> context, string errorMessage = null)
 {
     return(context.IsNotNull().IsNotEmpty(errorMessage));
 }