MySQLNumberTypeMapping' does not support value conversions

前端 未结 3 2108
余生分开走
余生分开走 2021-02-14 07:44

I\'ve added a few models that I used to connect to a SQL database with and are now porting to MySQL . I am getting this error when I run : dotnet ef update --context {cont

相关标签:
3条回答
  • 2021-02-14 07:58

    The MySQL data provider does not implement the value conversion feature. You are getting this exception because you are using enums as data types which must be converted by the MySQL data provider which does not implement this feature and therefore throws a NotImplementedException.

    This bug has already been reported: https://bugs.mysql.com/bug.php?id=89855

    There is also an open github issue: https://github.com/aspnet/EntityFrameworkCore/issues/11078

    In short, MySQL.Data.EntityFrameworkCore, running on .Net Core 2.0, does not function correctly while using Microsoft.EntityFrameworkCore.Relational 2.1.0-preview1-final, despite claims that 2.0 conformant providers should work on it.

    0 讨论(0)
  • 2021-02-14 08:09

    I was able to fix this issue by upgrading MySQL.Data.EntityFrameworkCore from 6.10.8 to 8.015 (released 2/1/2019) and upgrading .NET Core from 2.0 to 2.2.

    I believe the issue has been fixed in version 8.

    0 讨论(0)
  • 2021-02-14 08:20

    In order to continue development I found a suitable solution was to

    Install-Package Pomelo.EntityFrameworkCore.Mysql -version 2.1.0-rc1-final

    using nuget console and modify any reference of options.UseMySQL to options.UseMySql.

    This allowed me to continue with dotnet 2.1 and utilize a mysql database.

    Hope this helps!

    0 讨论(0)
提交回复
热议问题