Validation failed for one or more entities. See ‘entityvalidationerrors’ solution
Validation failed for one or more entities. See ‘ EntityValidationErrors’ property for moredetails. Unfortunately, there is no further information about
Workaround on how to view entityvalidationerrors details |
In EF programming, we sometimes encounter such an error:
However, follow his prompt “see ‘entityvalidationerrors’ property for more details.” to check in the exception, you can only see
You can’t see the specific reason why the attribute fails to pass the verification. Maybe many people encounter this situation.
Here we introduce an exception class, so that we can easily know which field has a problem.
That is system.data.entity.validation.dbentityvalidationexception. I believe the code knows how to write it. The simplest is
try { // write database } catch (DbEntityValidationException dbEx) { }
We can see it in dbex
So we can see Entityvalidationerrors details of all validation errors.
Similar Posts:
- Use of @OneToMany or @ManyToMany targeting an unmapped class: com.xxx.domain Error
- com.alibaba.fastjson.JSONException: syntax error, expect {, actual [, pos 0
- [Solved] org.springframework.dao.DataIntegrityViolationException: Error attempting to get column…
- [Solved] Springboot startup error: org.springframework.beans.factory.unsatisfieddependenceexception…
- [Solved] EF An error occurred while updating the entries. See the inner exception for details.
- System.Data.SqlTypes.SqlNullValueException: ‘Data is Null. This method or property cannot be called on Null values.’
- java.sql.SQLException: Fail to convert to internal
- org.hibernate.QueryException: could not resolve property
- Solutions to the exception of cannot simply fetch multiple bags
- mybatis: Property ‘configuration’ and ‘configLocation’ can not specified with together