Ejemplo n.º 1
0
 /// <summary>
 /// Adds an entity <see cref="ValidatorBase{TEntity}"/>.
 /// </summary>
 /// <typeparam name="TEntity">The entity <see cref="Type"/>.</typeparam>
 /// <typeparam name="TValidator">The validator <see cref="Type"/>.</typeparam>
 /// <param name="validator">The <see cref="ValidatorBase{TEntity}"/>.</param>
 /// <param name="value">The entity value.</param>
 /// <returns>The (this) <see cref="MultiValidator"/>.</returns>
 public MultiValidator Add <TEntity, TValidator>(ValidatorBase <TEntity> validator, TEntity value) where TEntity : class where TValidator : ValidatorBase <TEntity>
 {
     _validators.Add(() => validator.Validate(value).Messages);
     return(this);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IncludeBaseRule{TEntity, TInclude}"/> class.
 /// </summary>
 /// <param name="include">The base <see cref="ValidatorBase{TInclude}"/>.</param>
 internal IncludeBaseRule(ValidatorBase <TInclude> include)
 {
     _include = Check.NotNull(include, nameof(include));
 }