We have a lot of instances of number(5,0) in our oracle db for which oracle provider defaults to Int16. This causes an issue because we can have a larger value than allowed in the int16 range for the same. Oracle recommends to override the edm mappings with custom mappings (see docs: https://docs.oracle.com/cd/E56485_01/win.121/e55744/entityDataTypeMapping.htm#ODPNT8300 ).
The issue I am facing is even with those custom mappings in my asp.net mvc project's web.config the override is not applying. I also created a brand new console app to test this and no luck either.
Does anyone know how to make it work or have a better solution?
I probably should add this info,
- VS 2015 EF6 Oracle Managed Data Acesss latest version from NuGet
- I am aware the docs say you can manually edit the types in Table Mapping but when you try to change them it conflicts with the emd model and generates an error.
- Workaround in which you manually edit the xml to remove precision is good in short term but every time you have to update from DB it overwrites the changes. It's a chore since I have more than 40 enteries in some tables to be edited
(below is the entry in web.config/app.config)
<oracle.manageddataaccess.client>
<version number="*">
<edmMappings>
<edmMapping dataType="number">
<add name="bool" precision="1" />
<add name="byte" precision="3" />
<add name="int16" precision="4" />
<add name="int32" precision="9" />
<add name="int64" precision="18" />
</edmMapping>
</edmMappings>
<dataSources>
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
</dataSources>
</version>