DbContext.GetValidationErrors Method ()
Validates tracked entities and returns a Collection of DbEntityValidationResult containing validation results.
Assembly: EntityFramework (in EntityFramework.dll)
[SuppressMessageAttribute("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] public IEnumerable<DbEntityValidationResult> GetValidationErrors()
Return Value
Type: System.Collections.Generic.IEnumerable<DbEntityValidationResult>Collection of validation results for invalid entities. The collection is never null and must not contain null values or results for valid entities.
1. This method calls DetectChanges() to determine states of the tracked entities unless DbContextConfiguration.AutoDetectChangesEnabled is set to false. 2. By default only Added on Modified entities are validated. The user is able to change this behavior by overriding ShouldValidateEntity method.