Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

New Post: MySql .Net connector and EF6

$
0
0

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.

 


Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>