0

For a new project which has to target Linux and Windows, I am searching for a solution to support MySQL (or MariaDB).

Because we have to support those different platforms I wish to work on DNX Core5.0. However I can't find any nuget packages / connectors which I can use to connect to the database. the one that i find are not supported by DNX core 5.0.

Is there a way to connect to mysql in DNX core 5.0 ? Or do you have to fall back on ODBC connections, i don't know if this would work...

Further i was searching for an ORM to support this, my research till now found out that

  • Entity Framework 7 is not supporting MySQL at this moment. (and EF is not my favorite ORM at this moment)
  • NHibernate: Currently nobody is working on it and it will be difficult (breaking changes) to port it to DNX Core
  • Dapper: (MicroORM I know ...): This is supporting DNXCore but i need a vallid IConnection which I can't create.

Thanks for your feedback!

Rob

Rob Van Pamel
  • 734
  • 1
  • 8
  • 23

1 Answers1

1

I asked a similar question a couple of weeks ago. There is no MySql connector for DNX Core. I had to fall back to DNX 4.5.1 and was able to use MySql with Entity Framework in a project that's running inside a Docker container. Also see the response to my question.

Community
  • 1
  • 1
Alex Polkhovsky
  • 3,340
  • 5
  • 29
  • 37
  • But if you want to use this on Linux, you have to fall back on Mono, correct? – Rob Van Pamel Apr 13 '16 at 06:35
  • DNX projects are used to build and run .NET applications for Windows, Mac and Linux, so there is no need for Mono. As I said, I run my project inside a Docker container image that is based on Linux. – Alex Polkhovsky Apr 13 '16 at 12:32
  • okay, now i'm getting confused because i'm relative new to .NET CORE. I thought that according to this documentation [link](http://docs.asp.net/en/latest/conceptual-overview/dotnetcore.html#building-applications-with-net-core) with DNX 451 you have to install the .NET framework. Also looking at the picture below https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/84/75/metablogapi/4024.image_thumb_2466A41B.png it shows .NET CORE 5 is targetting linux ? Or what is the difference then between ? – Rob Van Pamel Apr 15 '16 at 07:01
  • 1
    Hmm. I took a look at the Dockerfile for the Docker image I run the project on and they do use Mono. https://hub.docker.com/r/microsoft/aspnet/ – Alex Polkhovsky Apr 15 '16 at 16:46
  • Thanks for the answer King Julian:-) So i was correct in my statements above :-) – Rob Van Pamel Apr 16 '16 at 11:30