简体   繁体   English

从edmx删除映射

[英]delete mapping from edmx

In the edmx file I deleted some of the properties because I don't want to add them to the POCO object, but each time I get that kind of exception: 在edmx文件中,我删除了一些属性,因为我不想将它们添加到POCO对象,但是每次遇到这种异常时:

Error   1   Error 3023: Problem in mapping fragments starting at line 255:Column COMPANY.contact_phone_number in table COMPANY must be mapped: It has no default value and is not nullable.

Why do I need map those columns if they don't have default values and are not nullable?? 如果这些列没有默认值并且不能为空,为什么还要映射这些列?

I get it. 我知道了。
I must map non-nullable fields without default value because when inserting there must be a value to the field! 我必须映射没有默认值的非空字段,因为插入时必须有一个值!

我不确定我是否完全理解,您有一个POCO类,然后同一类在EDMX中也有定义,并且您要在POCO中指定某些属性,还是在EDMX中指定某些属性?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM