Monday, November 23, 2015

See 'EntityValidationErrors' property for more details

This is an annoying error.  It generally occurs when calling SaveContext in EF.  It means that there was something wrong with the data you were trying to Save, but it's not going to tell you what exactly.  

Fortunately, there is an easy fix if you are running in the debugger.  To get EF to cough up the EntityValidationErrors, simply create a new watch with the following:

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

No comments:

Post a Comment