dotConnect for MySQLsupport@devart.com

Entity Framework Data Type Mapping

MySQL to .NET type mapping

Type mapping rules from this table are used when generating a model from a database with Entity Data Model Wizard in Visual Studio 2008 - 2013 and Create Model Wizard in Entity Developer.

MySQL data types

SSDL

CSDL

.NET

bool, boolean, bit(1)booleanBooleanSystem.Boolean
tinyintsbyteSByteSystem.SByte
tinyint unsignedtinyintByteSystem.Byte
smallint, yearsmallintInt16System.Int16
int, integer, smallint unsigned, mediumintintInt32System.Int32
bigint, int unsigned, integer unsigned, bitbigintInt64System.Int64
floatfloatSingleSystem.Single
double, realdoubleDoubleSystem.Double
decimal, numeric, dec, fixed, bigint unsigned, float unsigned, double unsigned, serialdecimalDecimalSystem.Decimal
date, timestamp, datetimedate, timestamp, datetimeDateTimeSystem.DateTime
timetimeTimeSystem.TimeSpan
char, varchar, tinytext, text, mediumtext, longtext, set, enum, nchar, national char, nvarchar, national varchar, character varyingchar, varchar, tinytext, text, mediumtext, longtext, set, enumStringSystem.String
binary, varbinary, tinyblob, blob, mediumblob, longblob, char bytebinary, varbinary, tinyblob, blob, mediumblob, longblobBinarySystem.Byte[]

.NET to MySQL default type mapping

.NET

CSDL

SSDL

MySQL data types

System.BooleanBooleanbooleanboolean, bit(1)
System.ByteBytetinyinttinyint unsigned
System.Byte[]Binarybinary, varbinary, blob, longblobbinary, varbinary, blob, longblob
System.DateTimeDateTimedatetimedatetime
System.DecimalDecimaldecimaldecimal
System.DoubleDoubledoubledouble
System.GuidGuidguidchar(36)
System.Int16Int16smallintsmallint
System.Int32Int32intint
System.Int64Int64bigintbigint
System.SByteSBytesbytetinyint
System.SingleSinglefloatfloat
System.StringStringchar, varchar, text, longtextchar, varchar, text, longtext
System.TimeSpanTimetimetime

DateTimeOffset type is not supported.

 

 


© 2002 - 2014 Devart. All rights reserved.