MySql .Net connector and EF6

Topics: EF Runtime
Nov 18, 2012 at 3:00 PM

Hi, as it stands for now MySql .Net connector is supporting EF code first 4.3, so it doesn´t work with EF6 out of the box.


One of my requirements is working with open source code as much as possible, so EF6 is the best bet for me. I´ve changed some namespaces and re-build MySql .net connector, but still doesn´t work. With new History Migration schema, MySql server is raising an exception due too long primary index, so I´ve changed default HistoryContext to my own, fine, it seems to work but some questions come to me.
To do that I´ve built MySqlHistoryContext (derived from HistoryContext) MySqlHistoryContextFactory (from HistoryContextFactory) and created a new MySqlDbConfiguration (from DbConfiguration) in which I injected my factory (with AddDependencyResolver) Finally, I configure my config file to use it all this:


<entityFramework codeConfigurationType="MySql.Data.Entity.MySqlDbConfiguration, MySql.Data.Entity">    <providers>      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity" />    </providers>  </entityFramework>


1.  My EF Provider always will need this new History Context (deafult one won´t working for MySql) so I would like to configure this History Context inside my own assembly by default. I think now this is not possible thus you have to include configuration in the same assembly as DbContext (this is not possible for this scenario) o configure it in config file (possible to do it, but this delegates to provider´s users to configure some internals of the provider, I think)
2. I´m not using DbMigrationConfiguration like step 4 here, I call AddDependencyResolver from my MySqlDbConfiguration to inject my own hisoty context directly. Is it OK? In this scenario, coding a EF provider with a modified hisoty context model, how could I derived from DbMigrationConfiguration<TContext>? I don´t know what context the user will use.

 

Developer
Nov 20, 2012 at 4:02 PM

I know this doesn't address your questions, but what version of Connector/Net are you using? Because, this looks like a bug (Bug #65289) that was fixed in versions 6.4.6, 6.5.5 & 6.6.3.

Nov 21, 2012 at 12:45 PM

Thanks Brice, I´m working with 6.6.4. It´s not the same problem, I can create keys of string type, but EF6 creates _migrationhistory table with too long compound primary key (two fields are of string type).

Mar 16, 2013 at 9:42 AM
Any chance you can share a MySQL .NET connector that works with Entity Framework 6?
Mar 18, 2013 at 12:26 PM
I´ve sent you my address in private...
Apr 29, 2013 at 12:19 PM
reinierdg wrote:
Any chance you can share a MySQL .NET connector that works with Entity Framework 6?
Did you got it working?
I'm having the same problem here.
Apr 29, 2013 at 2:07 PM
I got the code from RURIA, but I did not get it to work yet. I did not invest a lot of time. Maybe you can try to contact RURIA for the source as well. Good luck.
Jun 29, 2013 at 9:36 AM
I'd like to get EF6 working with MySQL as well. Are there any new developments on this?
Oct 10, 2013 at 5:40 PM
The MySQL team is going to release an alpha compatible with EF6 shortly. I've just been talking with them over the past few days. If you're on twitter, follow @gabrymartinez who is on that team for more details.
Oct 11, 2013 at 8:06 AM

Good to know, thx,.

Raúl Uría Elíces

Gerente de Cuentas

e-mail: [email removed]

web: www.zzircon.com

Tlf: 609 721021

Parque Científico Tecnológico de Cantabria

Edificio 3000 – Oficina 12

c/ Isabel Torres 11

39011 – Santander

España

Descripción: C:\Users\ruria\Pictures\ZZircon\Logos\0.1_Logo ZZIRCON.jpg


Este mensaje de correo electrónico y sus documentos adjuntos están dirigidos EXCLUSIVAMENTE a los destinatarios especificados. La información contenida puede ser CONFIDENCIAL y / o estar LEGALMENTE PROTEGIDA y no necesariamente refleja la opinión de este grupo de correo. Si usted recibe este mensaje por ERROR, por favor comuníqueselo inmediatamente al remitente y ELIMÍNELO ya que usted NO ESTA AUTORIZADO al uso, revelación, distribución, impresión o copia de toda o alguna parte de la información contenida. Gracias.

© ZZircon - TFNO 942 049422 – [email removed]

De: jlerman [email removed]
Enviado el: jueves, 10 de octubre de 2013 19:41
Para: [email removed]
Asunto: Re: MySql .Net connector and EF6 [entityframework:403680]

From: jlerman

The MySQL team is going to release an alpha compatible with EF6 shortly. I've just been talking with them over the past few days. If you're on twitter, follow @gabrymartinez who is on that team for more details.

Nov 28, 2013 at 3:34 PM
Hi All,

MySQL for Visual Studio and Connector/Net beta's both supporting EF6 are available:

Connector/Net 6.8.1 Beta
http://dev.mysql.com/downloads/connector/net/#downloads (on Developlment releases),
More infomation on the release and changes: http://forums.mysql.com/read.php?3,599837

Direct link MySQL for Visual Studio 1.1.1 Beta (including support for VS 2013 and EF 6).
https://cdn.mysql.com/Downloads/MySQLInstaller/mysql-visualstudio-plugin-1.1.1.msi
More information on the release and changes: http://forums.mysql.com/read.php?174,601041,601041#msg-601041