0

我正在使用Pomelo.EntityFrameworkCore.MySql库(版本 3.1.1.0)maria db.net core 3.1. 当有多个记录时,它会在mysqlconnector\src\MySqlConnector\Core\Row.cs:line 223"Unable to cast object of type 'System.String' to type 'System.Int32'."处抛出错误。如果有单条记录,则工作正常。如果还有更多,给我这个错误。非常感谢任何帮助。firstordefault()firstordefault(), first(), tolist()

下面是我的 startup.cs 代码,

services.AddDbContextPool<MariaDbContext>(options => options
.UseMySql("Server=localhost;Database=******;User=localuser;Password=****;", mySqlOptions => mySqlOptions
.ServerVersion(new Version(10, 4), ServerType.MariaDb)));```
4

0 回答 0