Encounter problems
Core version upgrade from 1.0 to 1.1, Operation MySQL database, query data encountered missingmethodexception problem, UPDATE, insert operation no problem.
If you are experiencing this problem, please refer to the following steps for the upgrade operation.
Operation Steps and Contents
- If your project has already cited the following sections, upgrade the content in turn:
Pm> update-Packagemicrosoft.entityframeworkcorepm> update-Package Microsoft.EntityFrameworkCore.SqlServerPM> update-PackageMicrosoft.EntityFrameworkCore.RelationalPM > Update-package microsoft.entityframeworkcore.tools-pre
- If you have not installed it, please use the installation statement
Pm> install-Packagemicrosoft.entityframeworkcorepm> install-Package Microsoft.EntityFrameworkCore.SqlServerPM> install-Package Microsoft.EntityFrameworkCore.RelationalPM> Install-package microsoft.entityframeworkcore.tools-pre
- After the installation is complete, if you reference the MySQL extension is the following version (or less than that version.) ) will still be unable to complete the query operation.
" MySql.Data.EntityFrameworkCore " " 7.0.6-ir31 "
- Remove the reference and use NuGet to install the SAPIENTGUARDIAN.ENTITYFRAMEWORKCORE.MYSQL
Pm> Install-package SAPIENTGUARDIAN.ENTITYFRAMEWORKCORE.MYSQL
- If the IDE you are using is vs Code, add the dependencies below in the Project.json
" SAPIENTGUARDIAN.ENTITYFRAMEWORKCORE.MYSQL " " 7.1.14 "
- Then execute the dotnet restore in the CLI
- Then you need to add the reference content to the Startup.cs.
using MySQL.Data.Entity.Extensions;
Well, the rest of the code doesn't change much. Try again and you will find that your system is working properly.
Reference documents
1.announcing Entity Framework Core 1.1 Rowan Miller
After the ASP. NET Core 1.1 upgrade, the solution to MySQL error is to operate.