Datatypes in Entity Framework

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
nilssonm
Posts: 23
Joined: Mon 25 Aug 2008 15:08

Datatypes in Entity Framework

Post by 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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by 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

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

Post by 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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 26 Nov 2008 10:52

Yes, you can do it freely. But be aware of possible overflows.

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

Post by nilssonm » Wed 26 Nov 2008 10:54

OK, thanks.

Post Reply