Example #1
0
 /// <summary>
 /// Validates that the parameter is not empty. Otherwise, an <see cref="System.ArgumentException" /> is thrown.
 /// </summary>
 /// <typeparam name="TParameter">The parameter type.</typeparam>
 /// <param name="validator">The <see cref="ParameterValidator{TParameter}" />.</param>
 /// <returns>The same instance of <see cref="ParameterValidator{TParameter}" />.</returns>
 /// <exception cref="System.ArgumentException">Thrown when the parameter is empty.</exception>
 public static ParameterValidator <TParameter> IsNotEmpty <TParameter>(this ParameterValidator <TParameter> validator)
     where TParameter : IEnumerable
 {
     return(validator.IsNotEmpty(ExceptionMessages.VALUE_CANNOT_BE_EMPTY));
 }
 /// <summary>
 /// Validates that the parameter is not empty. Otherwise, an <see cref="System.ArgumentException" /> is thrown.
 /// </summary>
 /// <param name="validator">The <see cref="ParameterValidator{TParameter}" />.</param>
 /// <returns>The same instance of <see cref="ParameterValidator{TParameter}" />.</returns>
 /// <exception cref="System.ArgumentException">Thrown when the parameter is empty.</exception>
 public static ParameterValidator <string> IsNotEmpty(this ParameterValidator <string> validator)
 {
     return(validator.IsNotEmpty(ExceptionMessages.VALUE_CANNOT_BE_EMPTY));
 }