Datatypes in Entity Framework

Datatypes in Entity Framework

Postby nilssonm » Tue 25 Nov 2008 13:08

Hi all,

I am wondering if it is possible to map a booelan (tinyint(1)) in the database to a .NET bool in my objectmodel.
The conversion from database type integer(11) to the .NET type Int64 also confuses me.

/Mats
nilssonm
 
Posts: 23
Joined: Mon 25 Aug 2008 15:08

Postby AndreyR » Wed 26 Nov 2008 09:50

The unsigned int is mapped to Int64, because it can cause an overflow of Int32.
The signed int is mapped to Int32, because when you create a column of int(11) in MySQL, it is saved in DB as the one of int(10) - that is the feature of MySQL.
The mapping of the boolean (tinyint(1)) is described in the post http://www.devart.com/forums/viewtopic.php?t=13493
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby nilssonm » Wed 26 Nov 2008 09:57

Thank you for the response. I am now wondering if it is possible to manually edit the edmx file to map the unsigned int's to be Int32 instead of the automatically mapped Int64's.

/Mats
nilssonm
 
Posts: 23
Joined: Mon 25 Aug 2008 15:08

Postby AndreyR » Wed 26 Nov 2008 10:52

Yes, you can do it freely. But be aware of possible overflows.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby nilssonm » Wed 26 Nov 2008 10:54

OK, thanks.
nilssonm
 
Posts: 23
Joined: Mon 25 Aug 2008 15:08


Return to dotConnect for MySQL