Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use EF Core (EF7) with Mysql server?

Tags:

I am developing asp.net 5 (now called ASP.NET Core) on linux. But I cannot connect between EF7 (now called EF Core) and Mysql server. Please tell me any solution that you knew.

Thanks.

like image 375
Thanh Truong Avatar asked Jul 01 '15 19:07

Thanh Truong


People also ask

Can I use Entity Framework core with MySQL?

EntityFrameworkCore. MySql is the most popular Entity Framework Core provider for MySQL compatible databases. It supports EF Core 3.1 (and lower) and uses MySqlConnector for high-performance database server communication.

Does dapper work with MySQL?

Dapper as an ORM is arguably one of the most powerful tools for querying and executing databases. I use Dapper because it has no DB specific implementation detail and implementation works with MySQL, MongoDB, SQLite, SQL, and PostgreSQL. Dapper provides two methods of interacting with your database query and execute.


Video Answer


2 Answers

All available providers are listed at https://docs.microsoft.com/en-us/ef/core/providers/. At time of writing, there are 3 different EF Core providers, two community versions and one official version.

UPDATE Sept 15, 2016

MySQL released the first version of an official provider for EF Core.

https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore

There is also a community version of a MySQL provider

https://www.nuget.org/packages/Pomelo.EntityFrameworkCore.MySQL

UPDATE May 23, 2016

MySQL has announced (quietly) that they are building an EF Core 1.0 provider. There are no details yet on its availability. See https://docs.efproject.net/en/latest/providers/mysql/index.html

Also, DevArt announced a month ago that their (proprietary, not-free) providers support EF 7 on .NET Framework only, including their MySQL provider. No news yet about their intention to support .NET Core. http://blog.devart.com/entity-framework-core-1-entity-framework-7-support.html

like image 85
natemcmaster Avatar answered Sep 20 '22 20:09

natemcmaster


I have good news, guys. Like one said : "Pas le temps de niaiser". Entity Framework 7 will support soon MySQL, trusting this page from the documentation : https://docs.efproject.net/en/latest/providers/mysql/index.html#coming-soon

like image 43
Christopher J. Avatar answered Sep 20 '22 20:09

Christopher J.