Exemple #1
0
 /// <summary>
 /// Validates that the parameter is not null or empty. Otherwise, an <see cref="ArgumentNullException" /> or <see cref="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="ArgumentNullException">Thrown when the parameter is null.</exception>
 /// <exception cref="ArgumentException">Thrown when the parameter is empty.</exception>
 public static ParameterValidator <TParameter> IsNotNullOrEmpty <TParameter>(this ParameterValidator <TParameter> validator)
     where TParameter : IEnumerable
 {
     return(validator.IsNotNullOrEmpty(ExceptionMessages.VALUE_CANNOT_BE_NULL_OR_EMPTY));
 }
 /// <summary>
 /// Validates that the parameter is not null or 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 null or empty.</exception>
 public static ParameterValidator <string> IsNotNullOrEmpty(this ParameterValidator <string> validator)
 {
     return(validator.IsNotNullOrEmpty(ExceptionMessages.VALUE_CANNOT_BE_NULL_OR_EMPTY));
 }