Numeric Data Type Mapping for EF Core 3 and Oracle

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
nruffing
Posts: 4
Joined: Fri 21 May 2021 13:24

Numeric Data Type Mapping for EF Core 3 and Oracle

Post by nruffing » Sat 17 Jul 2021 15:45

We are using EF Core 3 against an Oracle database.

We are currently noticing an issue with Entity Developer numeric data type mappings. Currently NUMBER(2,0) is mapping to Int32.

When we change or delete an entity EF Core throws an InvalidCastException because its trying to cast the integer to a byte.

According to this documentation I think Number(2,0) should map to byte by default.
https://docs.oracle.com/en/database/ora ... E7305E3F6A

Here is what appears to be the latest default mapping settings in Entity Developer.
  • Number -> Decimal
  • Number(1,0) -> Boolean
  • Number(2...9,0) -> Int32
  • Number(10...18,0) -> Int64
  • Number(1...15,-84...127) -> Double
We are currently using the latest version of Entity Developer (v6.11.1283).

Shalex
Site Admin
Posts: 9338
Joined: Thu 14 Aug 2008 12:44

Re: Numeric Data Type Mapping for EF Core 3 and Oracle

Post by Shalex » Mon 19 Jul 2021 11:08

The default type mapping for the Entity Framework feature in dotConnect for Oracle is described at http://www.devart.com/dotconnect/oracle ... pping.html.

The Database First mapping for the newly created models can be customized via Visual Studio > Tools > Entity Developer > Options > Server Options > Oracle. You can map Number(2,0) to byte.

Post Reply