src/Shared/EntityFramework/Internal/EntityEntries/InternalEntityEntry.cs
// <summary>
// Validates entity represented by this entity entry.
// This method is virtual to allow mocking.
// </summary>
// <param name="items"> User defined dictionary containing additional info for custom validation. This parameter is optional and can be null. </param>
// <returns>
// <see cref="DbEntityValidationResult" /> containing validation result. Never null.
// </returns>
Validates entity represented by this entity entry.
This method is virtual to allow mocking.
Validates entity represented by this entity entry . This method is virtual to allow mocking .
public virtual DbEntityValidationResult GetValidationResult(IDictionary<object, object> items)
        {
            var entityValidator = InternalContext.ValidationProvider.GetEntityValidator(this);
            var originalLazyLoadingFlag = InternalContext.LazyLoadingEnabled;
            InternalContext.LazyLoadingEnabled = false;
            DbEntityValidationResult result;
            try
            {
                result = entityValidator != null
                             ? entityValidator.Validate(
                                 InternalContext.ValidationProvider.GetEntityValidationContext(this, items))
                             : new DbEntityValidationResult(this, Enumerable.Empty<DbValidationError>());
            }
            finally
            {
                InternalContext.LazyLoadingEnabled = originalLazyLoadingFlag;
            }
            return result;
        }
public virtual DbEntityValidationResult GetValidationResult ( IDictionary < object , object > items ) { var entityValidator = InternalContext . ValidationProvider . GetEntityValidator ( this ) ; var originalLazyLoadingFlag = InternalContext . LazyLoadingEnabled ; InternalContext . LazyLoadingEnabled = false ; DbEntityValidationResult result ; try { result = entityValidator != null ? entityValidator . Validate ( InternalContext . ValidationProvider . GetEntityValidationContext ( this , items ) ) : new DbEntityValidationResult ( this , Enumerable . Empty < DbValidationError > ( ) ) ; } finally { InternalContext . LazyLoadingEnabled = originalLazyLoadingFlag ; } return result ; }
Validates entity represented by this entity entry.
Validates entity represented by this entity entry .
containing validation result. Never null.
containing validation result . Never null .
items
IDictionary<object, object>
User defined dictionary containing additional info for custom validation. This parameter is optional and can be null.
User defined dictionary containing additional info for custom validation . This parameter is optional and can be null .