src/Shared/EntityFramework/Internal/Validation/ValidationProvider.cs
// <summary>
// Gets a validator for the <paramref name="memberEntry" />.
// </summary>
// <param name="entityValidator"> Entity validator. </param>
// <param name="memberEntry"> Property to get a validator for. </param>
// <returns>
// Validator to validate <paramref name="memberEntry" /> . Possibly null if there is no validation for the
// <paramref
//     name="memberEntry" />
// .
// </returns>
// <remarks>
// For complex properties this method walks up the type hierarchy to get to the entity level and then goes down
// and gets a validator for the child property that is an ancestor of the property to validate. If a validator
// returned for an ancestor is null it means that there is no validation defined beneath and the method just
// propagates (and eventually returns) null.
// </remarks>
Gets a validator for the .
Gets a validator for the .
protected virtual PropertyValidator GetValidatorForProperty(
            EntityValidator entityValidator, InternalMemberEntry memberEntry)
        {
            var complexPropertyEntry = memberEntry as InternalNestedPropertyEntry;
            if (complexPropertyEntry != null)
            {
                var propertyValidator =
                    GetValidatorForProperty(entityValidator, complexPropertyEntry.ParentPropertyEntry) as
                    ComplexPropertyValidator;
                return propertyValidator != null && propertyValidator.ComplexTypeValidator != null
                           ? propertyValidator.ComplexTypeValidator.GetPropertyValidator(memberEntry.Name)
                           : null;
            }
            else
            {
                return entityValidator.GetPropertyValidator(memberEntry.Name);
            }
        }
protected virtual PropertyValidator GetValidatorForProperty ( EntityValidator entityValidator , InternalMemberEntry memberEntry ) { var complexPropertyEntry = memberEntry as InternalNestedPropertyEntry ; if ( complexPropertyEntry != null ) { var propertyValidator = GetValidatorForProperty ( entityValidator , complexPropertyEntry . ParentPropertyEntry ) as ComplexPropertyValidator ; return propertyValidator != null && propertyValidator . ComplexTypeValidator != null ? propertyValidator . ComplexTypeValidator . GetPropertyValidator ( memberEntry . Name ) : null ; } else { return entityValidator . GetPropertyValidator ( memberEntry . Name ) ; } }
Gets a validator for the .
Gets a validator for the .
// if a validator for parent property is null there is no validation for child properties.   // just propagate the null.
Validator to validate  . Possibly null if there is no validation for the


Validator to validate . Possibly null if there is no validation for the
entityValidator
EntityValidator
None
memberEntry
InternalMemberEntry
Property to get a validator for.
Property to get a validator for .
remarks
For complex properties this method walks up the type hierarchy to get to the entity level and then goes down
and gets a validator for the child property that is an ancestor of the property to validate. If a validator
returned for an ancestor is null it means that there is no validation defined beneath and the method just
propagates (and eventually returns) null.
For complex properties this method walks up the type hierarchy to get to the entity level and then goes down and gets a validator for the child property that is an ancestor of the property to validate . If a validator returned for an ancestor is null it means that there is no validation defined beneath and the method just propagates ( and eventually returns ) null .