src/Shared/EntityFramework/Internal/Validation/EntityValidatorBuilder.cs
// <summary>
// Builds <see cref="ValidationAttributeValidator" />s for given <paramref name="attributes" /> that derive from
// <see cref="ValidationAttribute" />.
// </summary>
// <param name="attributes"> Attributes used to build validators. </param>
// <returns>
// A list of <see cref="ValidationAttributeValidator" /> s built from <paramref name="attributes" /> . Possibly empty, never null.
// </returns>
Builds s for given  that derive from
.
Builds s for given that derive from .
protected virtual IList<IValidator> BuildValidationAttributeValidators(IEnumerable<Attribute> attributes)
        {
            DebugCheck.NotNull(attributes);
            return (from validationAttribute in attributes
                    where validationAttribute is ValidationAttribute
                    select new ValidationAttributeValidator(
                        (ValidationAttribute)validationAttribute,
                        attributes.OfType<DisplayAttribute>().SingleOrDefault()))
                .ToList<IValidator>();
        }
protected virtual IList < IValidator > BuildValidationAttributeValidators ( IEnumerable < Attribute > attributes ) { DebugCheck . NotNull ( attributes ) ; return ( from validationAttribute in attributes where validationAttribute is ValidationAttribute select new ValidationAttributeValidator ( ( ValidationAttribute ) validationAttribute , attributes . OfType < DisplayAttribute > ( ) . SingleOrDefault ( ) ) ) . ToList < IValidator > ( ) ; }
Builds s for given  that derive from
.
Builds s for given that derive from .
A list of  s built from  . Possibly empty, never null.
A list of s built from . Possibly empty never null .
attributes
IEnumerable<Attribute>
Attributes used to build validators.
Attributes used to build validators .