-First Step-
using mySql installer : https://dev.mysql.com/downloads/installer/
Download
1 - mySql router
2 - Connector/ODBC
3 - Connector/C++
4 - Connector/Net
5 - MySQl Server
All , exactly in version : 8.0.12
Then go to visual studio > manage nugget packages > browse(tab) (and install)
1 - entityFramework -> version 6
2 - mysql.data -> version 8.0.12
3 - mysql.data.entity -> version 6
4 - mysql.data.entityFramework -> version 8.0.12
Then go to visual studio > manage nugget packages > updates(tab)
update Google.protoBuf to version 3.6.0
-Second Step-
Right click your project > Add new Item > Data (left navbar) > Ado.net Data Model
The Connection dialogue will appear, create a new connection using your Mysql (version 8.0.12) credentials.
(check the input : include the sensitive data in the connectionString ..)
You will get an error ! that because the preconfigured MySqlProviderServices comes with the version 8.0.11 , all you have to do is to change it in the file App.config (next step).
the problem is : when you go look the latest version of MySql.Data.Entity is 6.10.7, so this means when download Connector/NET 8 then there is a version incompatibility which results in the ADO.Net data entity wizard closing.
-Third step (final)-
go to your App.config file , and change your "providers" Tag to become like that
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<!--<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />-->
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</providers>
Thats's All , now build the project and you're done you can create your Entity Data Model
(database first for example..) and map your MySql database and query it on your project
ressources :
https://www.youtube.com/watch?v=xvgeeaVP4M4
https://www.devjockeys.com/blog/c-sharp/using-entity-framework-with-mysql-a-code-first-example/
https://ozanecare.com/connect-mysql-with-visual-studio-2019/
Entity Framework With mysql Database First