Entity framework 指定的成员映射无效。在数据库中添加新列时ADO.net实体框架出错?
我对Entity framework 指定的成员映射无效。在数据库中添加新列时ADO.net实体框架出错?,entity-framework,ado.net,nopcommerce,Entity Framework,Ado.net,Nopcommerce,我对ADo.net实体framework非常陌生,我发现以下错误 The type 'Edm.Byte' of the member 'IsActive' in the conceptual side type NopSolutions.NopCommerce.BusinessLogic.Data.Language' does not match with the type System.Boolean' of the member 'IsActive' on the object s
ADo.net实体
framework非常陌生,我发现以下错误
The type 'Edm.Byte' of the member 'IsActive' in the conceptual side type
NopSolutions.NopCommerce.BusinessLogic.Data.Language' does not match with the type
System.Boolean' of the member 'IsActive' on the object side type NopSolutions.NopCommerce.BusinessLogic.Directory.Language'.
据我所知,与edm和对象的数据类型相关联的部分缺失
但我在数据库表中创建了一个位类型的列,并在langauge.cs
中声明了
public bool IsActive { get; set; }
我可以在这里发布任何需要的详细信息
编辑:
当我四处搜索时,我在stackoverflow上发现了这个问题
将字节更改为布尔值以映射tinyint
但在我的例子中,数据库中的文件也是位。假设您有一个可以修改的.edmx文件。在XML编辑器中打开它并搜索
-元素。这应该包含实体的定义,查找
-元素,该元素应该声明如下内容:
<Property Name="IsActive" Type="Byte" Nullable="false" />
将类型
-属性更改为布尔值
我很确定你也可以在designer中这样做,但如果你无法直接访问.edmx,请告诉我,我们可以解决一些问题。@Tihon感谢它的工作。我对.edmx文件有权限,所以右键单击该字段并将其数据类型更改为Boolean更新edmx是否不能解决此问题?