Entity Framework Code - First, MySQL and Unicode support

I am using EF Code-First (EFCF) with MySQL to create my database using Migrations. I have a problem with character columns.

I'm not a MySQL expert, but from what I've read, in MySQL you can support Unicode in your tables in at least two ways:

  • The default for the entire table is: CREATE TABLE mytable (...) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_unicode_ci;

  • Making each specific column support Unicode: CREATE TABLE myTable (col1 VARCHAR(10) CHARSET utf8, OtherColNotUnicode VARCHAR(5), ...);

    (note that MySQL does not have NVARCHAR)

As it turns out, EFCF Migrations creates tables and columns with no Unicode support by default, and I couldn't find a way to override or annotate properties in my model, basically forcing either option 1 or 2.

? , , , , , , .

, EF 5.0, MySql.Data MySql.Data.Entity v 6.6.4.0.

+3
mysql entity-framework




:

783
Entity Framework vs LINQ to SQL
630
Entity
468
MySQL?
142
" "?
9
/ Unicode MySql
2
Symfony Doctrine
1
-- mysql?
0
SQL insert and update does not update or insert all records, only a few records
-1
What's Better in Performance for 1-to-1 Relationships: New table or VARCHAR column with lots of empty records
-4
Database error in codeIgniter UserName cannot be null



All Articles
Loading...
X
Show
Funny
Dev
Pics