Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
来源:互联网 发布:联合证券交易软件下载 编辑:程序博客网 时间:2024/05/22 00:16
如果使用的是Code First,使用update database -verbose完成了miragtion 之后,运行发现异常:
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
这是由于migration对model的更改导致了db中column的限制(例如长度,StringLength(30)会导致nvarchar(max)变为nvarchar(30))
想要看到异常的具体信息,可以catch DbEntityValidationException :
try{ // Your code... // Could also be before try if you know the exception occurs in SaveChanges context.SaveChanges();}catch (DbEntityValidationException e){ foreach (var eve in e.EntityValidationErrors) { }}
0 0
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
- Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- entityframework-Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- 如何知道错误:Validation failed for one or more entities. See 'EntityValidationErrors' 的原因
- EF--Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- 如何处理 Validation failed for one or more entities. See 'EntityValidationErrors' 错误
- Validation failed for one or more entities
- Validation failed for one or more entities
- 错误:One or more post-processing actions failed. Consult the OPP service log for details
- ORACLE EBS 问题 -One or more post-processing action failed. Consult the OPP service log for details.
- an error has occurred.See error log for more details
- an error has occurred.See error log for more details
- An error has occurred. See error log for more details.
- An error hasoccurred. See error log for more details.
- vs2010全工程快速查找
- mfc关于IP地址控件
- 广告平台push_for_cfq, 笔记
- java continue和return的区别
- 中国最有意境的33句
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
- 基于Bloom-Filter算法的URL过滤器的实现
- AES 对字符串 加解密
- 算法学习——欧几里得算法
- 2015小米笔试题目(南京地区)
- win7中文版转英文版 只须下载安装语言包
- 关于Xcode的Other Linker Flags
- poj2376 Cleaning Shifts 贪心
- C socket编程