微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

将.NET布尔数据类型映射到实体框架中的oracle数(1,0)会抛出错误

将.NET布尔数据类型映射到.edmx文件中的oracle号(1,0)会抛出以下错误.

Error 2019: Member Mapping specified is not valid. The type
‘Edm.Boolean[Nullable=False,DefaultValue=]’ of member ‘COLUMN123’ in
type ‘DBModel.TABLE123’ is not compatible with
‘OracleEFProvider.number[Nullable=False,DefaultValue=,Precision=1,Scale=0]’
of member ‘CHECK_INSTALLATION’ in type ‘DBModel.Store.TABLE123’.

可以使用实体框架将布尔数据类型映射到oracle的数字(1,0)吗?

添加一个oracle.dataaccess.client部分对我来说是不够的.以下(从 Deploying and Configuring ODP.NET to work without installation with Entity Framework开始)工作:
<configuration>
  <configSections>
    <section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler,System.Data,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" />
    <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler,Oracle.ManagedDataAccess,Version=4.121.1.0,PublicKeyToken=89b483f429c47342" />
</configSections>
...
<oracle.dataaccess.client>
  <settings>
    <add name="bool" value="edmmapping number(1,0)" />
  </settings>
</oracle.dataaccess.client>
<oracle.manageddataaccess.client>
  <version number="*">
    <edmMappings>
      <edmMapping dataType="number">
        <add name="bool" precision="1"/>
        <add name="byte" precision="2" />
        <add name="int16" precision="5" />
      </edmMapping>
    </edmMappings>
  </version>
</oracle.manageddataaccess.client>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐