Getting exact error type in from DbValidationException

I have the situation where I’m initializing my model in DatabaseInitializer() for EF 4.1 and get this annoying error "Validation failed for one or more entities. See 'EntityValidationErrors' property for more details." So, I go to this EntityValidationErrors and there is a field {System.Data.Entity.Validation.DbEntityValidationResult} which gives me no information at all about what field it was unable to initialize.
Is there a way to get more info about this error?

To clear things out:

I know how to fix the string length problem. What I’m asking is how do I get the exact field name that is breaking the model.

8 Answers
8

Leave a Comment