zzzprojects / EntityFramework-Classic

Entity Framework Classic is a supported version of the latest EF6 codebase. It supports .NET Framework and .NET Core and overcomes some EF limitations by adding tons of must-haves built-in features.
https://entityframework-classic.net
Other
103 stars 27 forks source link

Port EF 6.3 migration generator #50

Closed kanadaj closed 4 years ago

kanadaj commented 4 years ago

Is there any chance for you guys to port the migration generator from EF 6.3 to EF Classic to support .NET Core 2?

Alternatively, could you possibly release Z.EntityFramework.Classic.MySql retargeted for EF 6.3? Oracle hasn't made any effort to release their provider for .NET Standard/Core, so even if we wanted to update to EF 6.3, we have no MySQL provider to use.

JonathanMagnan commented 4 years ago

Hello @kanadaj ,

We are waiting for the official release of EF 6.4 before merging changes in our branch. We might try as well to merge the latest 6.4 previews during Chrismas break at the end of December. So that's coming soon.

Alternatively, could you possibly release Z.EntityFramework.Classic.MySql retargeted for EF 6.3

So you want us to release a version for Entity Framework as well if I understand correctly?

I guess if we speak only for the work required, we mostly only need to change the reference from EF Classic to EF 6.3. So this part is easy.

The hard part is: How to name this package? Any suggestions?

We could maybe simply name it: Z.MySql.Data.EntityFramework maybe?

kanadaj commented 4 years ago

Hi @JonathanMagnan,

Z.MySql.Data.EntityFramework seems good to me! In reality this should really go to MySql.Data.EntityFramework but I have no high hopes that would ever happen with the way Oracle works...

And yes, you understand it correctly. Due to the dependency changes, old providers need to be recompiled for EF 6.3 and almost nobody did it so far, and EF Classic is basically already there, just need the line changed in MySqlDependencyResolver.cs:135. :)

And I didn't even realise until now that the EF6 MySQL provider was in fact inside the mysql-connector repo! I just realised about 30 minutes ago...

JonathanMagnan commented 4 years ago

Hello @kanadaj ,

Could you try the following package: https://www.nuget.org/packages/Z.MySql.Data.Entity/8.0.0

You will find the setup information in the readme of our fork: https://github.com/zzzprojects/mysql-connector-net

In short, you need to change the library name, version and public key (since their key was private ;( )

Could you confirm me that everything works as expected?

Best Regards,

Jon

kanadaj commented 4 years ago

Hi @JonathanMagnan, I'll check it out tomorrow! I don't use the .config file though, since I'm using EF Classic inside ASP.NET Core 2 (where the .config file support tends to be a bit weird, or as Brice Lambson said in https://github.com/aspnet/EntityFramework.Docs/issues/1784, "here be dragons", so I only use the code-based configuration)

In the meantime I ended up forking the library myself and - just for the sake of trying if it works -, try to retarget the EF Classic package to https://github.com/mysql-net/MySqlConnector/ for the underlying provider - and it was actually not terribly hard and is working fairly well! I have issues with the spatial support (that needs some more code, but personally I don't use spatial), but it's actually async so there is that. It might be worth looking at.

I'll get back to you as soon as I know if yours works

kanadaj commented 4 years ago

@JonathanMagnan Works as expected! :)

JonathanMagnan commented 4 years ago

Awesome @kanadaj,

Feel free to contact us for questions, issues or feedback.

Best regards,

Jon