参考:https://www.cnblogs.com/xiaof2000/p/efmysql.html
Vs2015
1.安装MySql.Data.Entity
Nuget 输入命令 :Install-package MySql.Data.Entity
2.在app.config里添加和
<!--手动添加-->
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<connectionStrings>
<add name="MySqlTest" connectionString="Data Source=localhost;port=3306;database=syd;user id=root;password=987123;" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
</configuration>
3.创建实体类完后,就可以正常使用了。