/// <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); }
/// <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)); }