Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with MySQL tinyint and Entity Framework code first

When I want to connect to MySQL by Entity framework (code first) I get this error:

(22,12) : error 2019: Member Mapping specified is not valid. The type 'Edm.Byte[Nullable=False,DefaultValue=]' of member 'Permission' in type 'News.Models.Author' is not compatible with 'MySql.tinyint[Nullable=False,DefaultValue=]' of member 'Permission' in type 'CodeFirstDatabaseSchema.Author'.

The name of colum in db is Permission with tinyint datatype. and the below is my class.

   public class Author
    {
     ...
     public byte Permission { get; set; }
     ...
    }
like image 537
Ghooti Farangi Avatar asked Jul 07 '26 20:07

Ghooti Farangi


1 Answers

It's fixed in Connector/Net 6.4.5 which is not out yet.

http://bugs.mysql.com/bug.php?id=62135

like image 191
Leon Avatar answered Jul 10 '26 11:07

Leon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!