"The "X" property on "Y" Could not be set to a 'null' value. You must set this property to a non-null value of type 'Int32'."
在EDMX中,如果转到Y表下方,然后单击X列,请右键单击,单击“属性”,向下滚动到Nullable
并从更改False
为True
。
如果出现“映射片段”错误,则必须从EDMX中删除该表并重新添加它,因为在模型浏览器中,它存储了表属性以及刷新该属性的唯一方法(我知道)是从“模型浏览器”中删除该表,<database>.Store
然后使用Update Model from Database..
命令检索该表。