MySQL Forums
Forum List  »  MySQL for Visual Studio

Re: Entity frame work
Posted by: JOSE RAMIREZ
Date: August 30, 2019 02:10PM

Hello Bill,

To generate EF6 models using the Entity Model Wizard in Visual Studio you must have MySQL for Visual Studio and MySQL Connector/NET installed. Additional to that, your web project must have a correctly configured Web.config file (see the example below where MySql.Data 8.0.17 is being used) and your project must include references to the EntityFramework, EntityFramework.SqlServer, MySql.Data and MySql.Data.EF6/EntityFramework assemblies. After correctly configuring your project it is advised to rebuild it.


<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
...
<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=8.0.17, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.EntityFramework.MySqlConnectionFactory, MySql.Data.EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.17, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>


Regards.

====================================
Jose Ramirez
MySQL on Windows Team

Options: ReplyQuote


Subject
Views
Written By
Posted
478
March 01, 2019 02:32PM
290
March 26, 2019 05:32AM
Re: Entity frame work
202
August 30, 2019 02:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.