1. 安装EF Core连接MySQL的驱动,这里有两类:
(1).Oracle官方出品:MySql.Data.EntityFrameworkCore (版本:8.0.17)
(2).其他第三方出品:Pomelo.EntityFrameworkCore.MySql (版本:2.2.0)
8.0.11版本的官方包,大概会抛出这个错误:
The 'MySQLNumberTypeMapping' does not support value conversions. Support for value conversions typically requires changes in the database provider.
主要是不支持值转换吧,用第三方包可以解决。
如果你是.NET Core 2.1的话,
建议nuget包安装Pomelo.EntityFrameworkCore.MySql (版本:2.1.0)
2. 关于连接字符串:
Today's comments have reached the limit. If you want to comment, please wait until tomorrow (UTC-Time).
There is 20h02m44s left until you can comment.