Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework generates short instead of int

We are using Entity Framework database-first for our Oracle database.

For some reason Number(5) becomes Int16 - short

Max Number(5) value is 99999
Max Int16 value is 32767

Problem... is there a way to instruct the mapper to translate Number(5) to int32?

like image 882
gdoron is supporting Monica Avatar asked Sep 09 '12 14:09

gdoron is supporting Monica


1 Answers

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...

like image 74
gdoron is supporting Monica Avatar answered Sep 28 '22 16:09

gdoron is supporting Monica