EF Core scaffold table with number(1) maps to c# bool

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
[email protected]
Posts: 6
Joined: Tue 12 May 2020 08:50

EF Core scaffold table with number(1) maps to c# bool

Post by [email protected] » Wed 10 Jun 2020 08:51

Hi,

When scafollding an oracle db with ef core devart's provider a table with column number(1) becomes bool on c#. On my C# side when inserting a row entering true or false becomes 0 or 1 on oracle, but the correct value from the DB's perspective is 0(false) -1(true). What is the logic behind this, how devart knows that this column should be mapped as bool? Shouldn't it be mapped as a short instead of bool? Is there any way to change this behavior?

Thanks

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

Re: EF Core scaffold table with number(1) maps to c# bool

Post by Shalex » Thu 11 Jun 2020 13:55

You can change default number mapping by adding "Number Mappings = (Integer, 1, 1, System.Int16);" to your connection string.

Refer to https://www.devart.com/dotconnect/oracl ... tring.html.

Post Reply