Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malkitsingh/5843797d3d852c6180dd to your computer and use it in GitHub Desktop.
Save malkitsingh/5843797d3d852c6180dd to your computer and use it in GitHub Desktop.
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
catch (DbEntityValidationException ex)
{
foreach (var validationErrors in ex.EntityValidationErrors)
{
foreach (var validationError in validationErrors.ValidationErrors)
{
Trace.TraceInformation("Property: {0} Error: {1}",
validationError.PropertyName,
validationError.ErrorMessage);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment