src/EntityFramework/Internal/Validation/EntityValidator.cs
// <summary>
// Validates type properties. Any validation errors will be added to <paramref name="validationErrors" />
// collection.
// </summary>
// <param name="entityValidationContext"> Validation context. Must not be null. </param>
// <param name="parentProperty"> The entry for the complex property. Null if validating an entity. </param>
// <param name="validationErrors"> Collection of validation errors. Any validation errors will be added to it. </param>
// <remarks>
// Note that <paramref name="validationErrors" /> will be modified by this method. Errors should be only added,
// never removed or changed. Taking a collection as a modifiable parameter saves a couple of memory allocations
// and a merge of validation error lists per entity.
// </remarks>
Validates type properties. Any validation errors will be added to
collection.
Validates type properties . Any validation errors will be added to collection .
protected override void ValidateProperties(
            EntityValidationContext entityValidationContext, InternalPropertyEntry parentProperty,
            List<DbValidationError> validationErrors)
        {
            DebugCheck.NotNull(entityValidationContext);
            DebugCheck.NotNull(validationErrors);
            var entityEntry = entityValidationContext.InternalEntity;
            foreach (var validator in PropertyValidators)
            {
                validationErrors.AddRange(
                    validator.Validate(entityValidationContext, entityEntry.Member(validator.PropertyName)));
            }
        }
protected override void ValidateProperties ( EntityValidationContext entityValidationContext , InternalPropertyEntry parentProperty , List < DbValidationError > validationErrors ) { DebugCheck . NotNull ( entityValidationContext ) ; DebugCheck . NotNull ( validationErrors ) ; var entityEntry = entityValidationContext . InternalEntity ; foreach ( var validator in PropertyValidators ) { validationErrors . AddRange ( validator . Validate ( entityValidationContext , entityEntry . Member ( validator . PropertyName ) ) ) ; } }
Validates type properties.
Validates type properties .
entityValidationContext
EntityValidationContext
Validation context. Must not be null.
Validation context . Must not be null .
parentProperty
InternalPropertyEntry
The entry for the complex property. Null if validating an entity.
The entry for the complex property . Null if validating an entity .
validationErrors
List<DbValidationError>
Collection of validation errors. Any validation errors will be added to it.
Collection of validation errors . Any validation errors will be added to it .
remarks
Note that  will be modified by this method. Errors should be only added,
never removed or changed. Taking a collection as a modifiable parameter saves a couple of memory allocations
and a merge of validation error lists per entity.
Note that will be modified by this method . Errors should be only added never removed or changed . Taking a collection as a modifiable parameter saves a couple of memory allocations and a merge of validation error lists per entity .