Home » Ado.Net » Entity Framework » Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details.

Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details.

With EF4.1, EF4.3 and EF5.0 you may have an Entity Validation Error and you may not found how to get the detail of the error. Entity Framework encapsulate the error into a class named DbEntityValidationException which is not casted in the debugger.

Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details.

To be able to get the information, you can add to your Watch Panel (inside Visual Studio) or into the Immediate Panel or Quick Watch the following line when the error occur:

((System.Data.Entity.Validation.DbEntityValidationException)$exception).EntityValidationErrors

From here, you will be able to get which entity is in error and what is the error. Data Annotation error or validation error will be clearly written inside the DbEntityValidationException.

If you like my article, think to buy my annual book, professionally edited by a proofreader. directly from me or on Amazon. I also wrote a TypeScript book called Holistic TypeScript

3 Responses so far.

  1. Tobias says:

    We are a group of volunteers and starting a new scheme in our community.
    Your website offered us with valuable information to work on.
    You have done an impressive job and our entire
    community will be thankful to you.

  2. car wax wash says:

    Useful information. Fortunate me I found your web site by chance, and I’m surprised why this twist of fate didn’t happened in
    advance! I bookmarked it.

  3. com.sg says:

    What’s up Dear, are you really visiting this website on a regular basis, if so after that you will definitely get nice knowledge.

Leave a Reply to car wax wash Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.