EF 5.0 Model First - How To Make Not Mapped Properties

被刻印的时光 ゝ 提交于 2019-12-06 01:39:45

NotMapped properties are not part of your mapping. When the model first approach is used EDMX represents the mapping so every property defined in the diagram is mapped. If you want to have non-mapped property it must not be defined in the diagram. All classes generated by EF's code generation are partial so you only need to create your own partial part of the class (it must be in the same namespace and assembly as generated part) and define your non-mapped property in code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!