c# 检查报错详细
catch (DbEntityValidationException error) { string test = string.Empty; foreach (var validationErrors in error.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { test = string.Format("Class: {0}, Property: {1}, Error: {2}", validationErrors.Entry.Entity.GetType().FullName, validationError.PropertyName, validationError.ErrorMessage); } } }