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); }
public static IValidationContext <string> IsNotNullOrEmpty(this IValidationContext <string> context, string errorMessage = null) { return(context.IsNotNull().IsNotEmpty(errorMessage)); }