System.ComponentModel.DataAnnotations.Schema 冲突
2015-07-21 15:25
225 查看
System.ComponentModel.DataAnnotations.Schema 冲突
Entity Framework 与 .net4.5 的 System.ComponentModel.DataAnnotations 都有 System.ComponentModel.DataAnnotations.Schema 命名空间。并且都有一些相同的 特性(Attribute), 如:ForeignKeyAttribute, NotMappedAttribute 等。当项目同时引用了 EntityFramework.dll 与 System.ComponentModel.Composition.dll ,你将不能正常使用上面提到的特性。使用别名,给这两个dll 加一个不同的根。
引用dll, 默认的别名都是 global
将 EntityFramework.dll 的别名改为 EF
在类的using 区域写入 extern alias EF;
*using EF::System.ComponentModel.DataAnnotations.Schema 引用别名加命名空间
*
*
相关文章推荐
- 模拟iOS网络环境
- H264视频的sps和pps解析和哥伦布编码
- viod运算符
- ADO.NET (二)—— ADO和ADO .NET对比
- 基于模式识别的的内窥镜肿瘤检测
- hdu 1022 Train Problem I
- 基于模式识别的的内窥镜肿瘤检测
- Git相关
- linux下安装php扩展memcache
- linux下安装php扩展memcache
- CentOS 7.0关闭默认防火墙firewalld,使用iptables
- 两个java对象相同属性赋值
- 栈 poj1068 Parencodings
- 【玩转cocos2d-x之二十一】多线程和同步01-pthread库
- 【玩转cocos2d-x之二十】从CCObject看cocos2d-x的内存管理机制
- 读取xml文件里switch节点的IP和设备信息,ping设备,异常显示在列表里
- GoodSync
- 矩阵及其变换、特征值与特征向量的物理意义
- 翻译-Salt与Ansible全方位比较
- zookeeper+activemq主备简单配置