Recently, I tried to use MySQL in EF, so I tested it.
My environment is vs2013+ef6+mysql5.7.4.
The first thing to download is MySQL for VisualStudio 1.1.4, Connectornet 6.8.3 two things.
Then add entityframework (not EF5) and MySQL.Data.Entities (this is also version 6th) in the NuGet package.
Two DLLs that will be like when you add one
The EntityFramework node under the corresponding config file is then modified or added
<entityFramework> <providers> <provider invariantname= "MySql.Data.MySqlClient" type= " MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6 "/> </providers> </ Entityframework>
Then you can add the MySQL entity by generating it from the database according to the usual method of adding entities.
As for the use of EF, and the operation of the MSSQL is not much different, it is no longer explained.
This article is just to record the EF connection to MySQL Memo!! Hope to help friends who meet the same problem