Entity Framework generates short instead of int

╄→гoц情女王★ 提交于 2019-12-04 09:36:00

Solved it, Added this to the web.config:

<oracle.dataaccess.client>
<settings>
<add name="int16" value="edmmapping number(4,0)" />
<add name="int32" value="edmmapping number(9,0)" />
</settings>
</oracle.dataaccess.client>

Recreated the Model with the *.edmx file and...

Now Number(5) is Int32 instead of Int16 and Number(10) is Int64 instead of Int32

I hope it'll help someone else in the future...

Oracle with EntityFramework for me has always resulted in having a sheet of changes I have to apply to my edmx file after it's generated.

Aside from changing the column's dataType, I'd suggest manually editing the row's type in the edmx file and just remembering this is something you'll have to do everytime you re-generate

For Oracle.ManagedDataAccess.Client, I try this work, and notice the question in top post comment:

<oracle.manageddataaccess.client>
    <version number="*"> 
      <edmMappings>
        <edmNumberMapping>
          <add NETType="int16" MinPrecision="2" MaxPrecision="4" DBType="Number" />
          <add NETType="int32" MinPrecision="5" MaxPrecision="9" DBType="Number" />
          <add NETType="int64" MinPrecision="10" MaxPrecision="19" DBType="Number" />
          <add NETType="bool" MinPrecision="1" MaxPrecision="1" DBType="Number" />
        </edmNumberMapping>
      </edmMappings>
    </version>
  </oracle.manageddataaccess.client>

`

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!