EF Core

Entity Framework (EF) Core is a lightweight, extensible, open source and cross-platform version of the popular Entity Framework data access technology.

EF Core can serve as an object-relational mapper (ORM), which:

  • Enables .NET developers to work with a database using .NET objects.
  • Eliminates the need for most of the data-access code that typically needs to be written.

Installation

Install globally with:

dotnet tool install --global dotnet-ef

To update the tools:

dotnet tool update

Usage

Create first migration

dotnet ef migrations add <migration-name>

The database update command creates the database and applies the new migration to it.

dotnet ef database update

MySQL/MariaDB support

Pomelo NuGet package

Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector