DIPSAS / Dapper.Oracle

Oracle support for Dapper Micro ORM.
MIT License
113 stars 43 forks source link

Using SuppressGetDecimalInvalidCastException #60

Open Shtong opened 1 year ago

Shtong commented 1 year ago

Hi,

We are using Dapper.Oracle, and are sometimes getting InvalidCastException errors when reading decimal values from Oracle, if these values contain too many decimals.

This is a known problem in the Oracle .NET driver. Oracle has provided a way to avoid it : the SuppressGetDecimalInvalidCastException property in the OracleDataReader class that has to be set to true to round the numbers just enough so that they can be read by .NET. However, Dapper does not allow direct access to the data readers, and so we cannot set this property while using Dapper.

Would there be a way to do this with Dapper.Oracle ? Would it be possible to add such a feature ?