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

前端之家收集整理的这篇文章主要介绍了将.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>

猜你在找的Oracle相关文章