Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql 1.0.0

dotnet add package Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql --version 1.0.0
                    
NuGet\Install-Package Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql --version 1.0.0
                    
#r "nuget: Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Loic.PomeloFoundation.Pomelo.EntityFrameworkCore.MySql&version=1.0.0
                    
Install as a Cake Tool

Pomelo.EntityFrameworkCore.MySql

Build Status NuGet Pomelo.EntityFrameworkCore.MySql package in pomelo-efcore-public feed in Azure Artifacts Join the chat at https://gitter.im/PomeloFoundation/Home

Pomelo.EntityFrameworkCore.MySql is the most popular Entity Framework Core provider for MySQL compatible databases. It supports EF Core up to its latest version and uses MySqlConnector for high-performance database server communication.

Compatibility

Dependencies

The following versions of MySqlConnector, EF Core, .NET (Core), .NET Standard and .NET Framework are compatible with Pomelo.EntityFrameworkCore.MySql:

Release Branch MySqlConnector EF Core .NET Standard .NET (Core) .NET Framework
6.0.0-<br />preview.5 master >= 1.3.10 6.0.0-<br />preview.5 N/A 5.0+ N/A
5.0.1 5.0-maint >= 1.3.7 5.0.x 2.1 3.0+ N/A
3.2.6 3.2-maint >= 0.69.10 < 1.0.0 3.1.x 2.0 2.0+ 4.6.1+
2.2.6 2.2-maint >= 0.59.2 < 1.0.0 2.2.6 2.0 2.0+ 4.6.1+

Packages

Supported Databases and Versions

Pomelo.EntityFrameworkCore.MySql is tested at least against the latest 2 minor versions of MySQL and MariaDB. Older versions and other server implementations (e.g. Amazon Aurora) may be compatible (and likely are to a high degree) but are not officially supported or tested.

Currently supported versions are:

  • MySQL 8.0
  • MySQL 5.7
  • MariaDB 10.5
  • MariaDB 10.4
  • MariaDB 10.3

Schedule and Roadmap

Milestone Status Release Date
6.0.0 In Development TBA (see #1413)
6.0.0-preview.5 Released 2021-06-27
6.0.0-preview.4 Released 2021-05-25
5.0.1 Released 2021-06-27
3.2.6 Released 2021-06-27
3.0.1 Released 2019-12-04
2.2.6 Released 2019-10-15
2.1.4 Released 2018-11-29

Nightly Builds

To use nightly builds from our Azure DevOps feed, add a NuGet.config file to your solution root with the following content and enable prereleases:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="Pomelo" value="https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json" />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

Getting Started

1. Project Configuration

Ensure that your .csproj file contains the following reference:

<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.1" />

2. Services Configuration

Add Pomelo.EntityFrameworkCore.MySql to the services configuration in your the Startup.cs file.

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        // Replace with your connection string.
        var connectionString = "server=localhost;user=root;password=1234;database=ef";

        // Replace with your server version and type.
        // Use 'MariaDbServerVersion' for MariaDB.
        // Alternatively, use 'ServerVersion.AutoDetect(connectionString)'.
        // For common usages, see pull request #1233.
        var serverVersion = new MySqlServerVersion(new Version(8, 0, 25));

        // Replace 'YourDbContext' with the name of your own DbContext derived class.
        services.AddDbContext<YourDbContext>(
            dbContextOptions => dbContextOptions
                .UseMySql(connectionString, serverVersion)
                .EnableSensitiveDataLogging() // <-- These two calls are optional but help
                .EnableDetailedErrors()       // <-- with debugging (remove for production).
        );
    }
}

View our Configuration Options Wiki Page for a list of common options.

3. Sample Application

Check out our Integration Tests for an example repository that includes an MVC Application.

There are also many complete and concise sample console applications posted in the issue section (some of them can be found by searching for Program.cs).

4. Read the EF Core Documentation

Refer to Microsoft's EF Core Documentation for detailed instructions and examples on using EF Core.

Scaffolding / Reverse Engineering

Use the EF Core tools to execute scaffolding commands:

dotnet ef dbcontext scaffold "Server=localhost;Database=ef;User=root;Password=123456;TreatTinyAsBoolean=true;" "Pomelo.EntityFrameworkCore.MySql"

Contribute

One of the easiest ways to contribute is to report issues, participate in discussions and update the wiki docs. You can also contribute by submitting pull requests with code changes and supporting tests.

We are always looking for additional core contributors. If you got a couple of hours a week and know your way around EF Core and MySQL, give us a nudge.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 7/31/2021