Wednesday, May 16, 2012

Which property caused "System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details." exception?

No comments:
Sometimes when using ASP.NET MVC 3 / 4 with Entity Framework it can be difficult to see exactly which property is causing issues when db.SaveChanges() is called. If you wrap the db.SaveChanges() in an appropriate try {} catch {} block whilst debugging (see below) each property in conflict will be written to your debug console which is much more helpful in finding and resolving the...
Read More