Mapping and metadata information could not be foun
2015-12-30 00:00
477 查看
摘要: EF 在添加实体的时候抛出来的异常
Mapping and metadata information could not be found for EntityType 'XXXXX',
EF 在添加实体的时候抛出来的异常
Mapping and metadata information could not be found for EntityType 'XXXXX',
在stackoverflow 搜出来的答案是:
http://stackoverflow.com/questions/2350514/ef-mapping-and-metadata-information-could-not-be-found-for-entitytype-error
For anyone else dealing with the error, I think it's worth mentioning some scenarios that I've found that cause this (extremely unhelpful) error:
Misspelled properties (case-sensitive!)
Properties missing in the POCO class
Type mismatches between the POCO and entity-type (e.g., int instead of long)
Enums in the POCO (EF doesn't support enums right now as I understand)
There might be other causes as well.
大概意思是你的属性错误
我看了看 又不太可能
然后一个一个去找的时候发现是 枚举不能为默认值(我是用moq 来模拟的 所以没注意到,一般的情况下,不会有这样的情况发生)
Mapping and metadata information could not be found for EntityType 'XXXXX',
EF 在添加实体的时候抛出来的异常
Mapping and metadata information could not be found for EntityType 'XXXXX',
在stackoverflow 搜出来的答案是:
http://stackoverflow.com/questions/2350514/ef-mapping-and-metadata-information-could-not-be-found-for-entitytype-error
For anyone else dealing with the error, I think it's worth mentioning some scenarios that I've found that cause this (extremely unhelpful) error:
Misspelled properties (case-sensitive!)
Properties missing in the POCO class
Type mismatches between the POCO and entity-type (e.g., int instead of long)
Enums in the POCO (EF doesn't support enums right now as I understand)
There might be other causes as well.
大概意思是你的属性错误
我看了看 又不太可能
然后一个一个去找的时候发现是 枚举不能为默认值(我是用moq 来模拟的 所以没注意到,一般的情况下,不会有这样的情况发生)
相关文章推荐
- Android 百度地图开发(二)
- Eclipse maven webapp项目目录结构配置 java build path 出现问题
- 蜂窝教育iOS培训:让技术武装您 企业重用您
- Android DexClassLoader调用其他apk中的函数
- IOS9.0后_视频
- IOS 终端命令
- IOS 终端命令2
- IOS 将项目上传到GitHub 上的方法步骤(任何项目)
- iOS - folder和group的区别,bundle文件夹(资源文件)得创建
- IOS - 字典和数组的copy使用
- iOS- 应用程序对象UIApplication
- NSObject易误解处
- iOS - performSelector方法的使用
- QUARTUSII 11.0 中的SOPC中如何更改NIOS II(如增加一个POI)
- android属性动画(一)
- [iOS]在tableview中用动画效果改变cell的高度
- Android 启动模式简介
- android application对象多次实例化
- Android 动态广播 和 静态广播的区别
- Android PowerManager