Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySql in DNX 5.0

I would like to ask- is it possible to connect to MySql database in DNX Core 5.0? In my project I need to do web api and I have vNext Class Library project that should connect to MySql database and manipulate the data in this database. But...

I have the newest .net/connector installed. I have downloaded the MySql.Data NuGet package and in references it is added to both- DNX 4.5.1 and Core 5.0 as well. But I get error- functions such as open the connection to my database, execute query etc are not available in DNX Core 5.0. The code is working in Visual Studio 2013 and in DNX 4.5.1 as well. I am not able to find any answer how to connect in DNX Core 5.0 to MySql (neither if it is even possible).

I was advised to downolad the source code of the newest connector/net and copy the code for MySql.Data to new vNext Class Library project and add reference to my Class Library that is supposed to access the database. But I have approx 1600 errors. I was told to solve them one by one. But that seems to be even bigger problem. It looks like it would be possible to solve by adding several references but I cannot find the equivalent reference that would work for DNX Core 5.0. Is this a good approach?

I would appreciate any help. Thank you.

like image 651
micihime Avatar asked Jul 07 '15 20:07

micihime


1 Answers

Saldy it's not in EntityFramework 7 yet, my understanding is that they're not prioritizing it for the initial release that's scheduled in January.

Read more: https://github.com/aspnet/EntityFramework/wiki/Using-EF7-in-Traditional-.NET-Applications

like image 163
muntr Avatar answered Oct 06 '22 07:10

muntr