.NET Mapping In entity framework, converting a Boolean datatype to an Oracle number(1,0) causes an error.

.net entity-framework

Question

Mapping .NET boolean datatype to oracle number(1,0) in .edmx file throws following error.

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'.

Can a Boolean datatype be mapped to oracle's number(1,0) using entity framework?

1
17
2/1/2012 12:19:42 PM

Popular Answer

Adding a oracle.dataaccess.client section wasn't sufficient for me. The following (taken from Deploying and Configuring ODP.NET to work without installation with Entity Framework) did work:

<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, Culture=neutral, 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>
8
5/23/2017 12:25:47 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow