vs entityframwork Validation failed for one or more entities
问题:添加数据库一条数据时出错
查找异常
catch (DbEntityValidationException dbEx)
{ foreach (var validationErrors in dbEx.EntityValidationErrors)
{ foreach (var validationError in validationErrors.ValidationErrors)
{ Trace.TraceInformation("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); } } }