gpt4 book ai didi

mysql - MySQL tinyint 和 Entity Framework 代码首先出现问题

转载 作者:可可西里 更新时间:2023-11-01 08:37:48 33 4
gpt4 key购买 nike

当我想通过 Entity Framework (代码优先)连接到 MySQL 时,出现此错误:

(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; }
...
}

最佳答案

它已在尚未发布的 Connector/Net 6.4.5 中修复。

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

关于mysql - MySQL tinyint 和 Entity Framework 代码首先出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5718193/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com