Skip to main content

Oracle MySql.EntityFrameworkCore vs Pomelo for EF Core 10: Which MySQL Provider to Use in .NET C#

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

To use EF Core with MySQL you need a database provider, a NuGet package that teaches EF Core how to talk to MySQL. There are two serious choices: Oracle's MySql.EntityFrameworkCore and the community's Pomelo.EntityFrameworkCore.MySql. For a long time Pomelo was the usual answer. For EF Core 10, the deciding fact is simpler: only one of them has a release. Here's what I checked, from the package feed and the package files themselves, and what I learned building a .NET 10 Web API on Oracle's provider.

The Short Answer​

Oracle MySql.EntityFrameworkCorePomelo.EntityFrameworkCore.MySql
Newest stable version10.0.129.0.0
Supports EF Core 10YesNo, not even as a preview
MaintainerOracle (the MySQL team)Pomelo Foundation, community
LicenceGPL-2.0-only WITH Universal-FOSS-exception-1.0MIT
ADO.NET driver underneathMySql.Data (Oracle's Connector/NET)MySqlConnector
Registration methodUseMySQL(…)UseMySql(…)
Databases, per Microsoft's listMySQLMySQL, MariaDB

For a .NET 10 project on EF Core 10, that's Oracle's provider. For a project on EF Core 9, or one that needs MariaDB, Pomelo is the established choice.

Prerequisites​

  • The .NET SDK to run the checks yourself: dotnet package search needs 8.0.2xx or later. The examples use .NET 10.

Check 1: Which Versions Exist​

dotnet package search --exact-match lists every version of a package, oldest first:

Terminal
dotnet package search MySql.EntityFrameworkCore --exact-match --prerelease --format json
dotnet package search Pomelo.EntityFrameworkCore.MySql --exact-match --prerelease

The last versions in each list, which I copied from the two outputs into one table:

PackageLast versions listed
MySql.EntityFrameworkCore… 9.0.20, 10.0.0-preview, 10.0.0-rc, 10.0.1, 10.0.7, 10.0.9, 10.0.12, 11.0.0-preview
Pomelo.EntityFrameworkCore.MySql… 9.0.0-preview.3.efcore.9.0.0, 9.0.0-rc.1.efcore.9.0.0, 9.0.0

A terminal showing the newest versions from dotnet package search: MySql.EntityFrameworkCore ends at 10.0.12 and an 11.0.0 preview, while Pomelo.EntityFrameworkCore.MySql ends at 9.0.0.

Oracle ships with EF Core's release cycle, a preview for EF Core 11 included. Pomelo's newest version is 9.0.0. How to Search for NuGet Packages from the Command Line covers the command.

Microsoft's database providers page lists both "For EF Core 8, 9" at the time of writing, so for Oracle's provider it's behind the package feed. Trust the feed for versions.

Check 2: What the Packages Themselves Say​

A package's .nuspec, in NuGet's cache after a restore, holds its licence and dependencies. For the two versions above:

  • Oracle MySql.EntityFrameworkCore 10.0.12: licence GPL-2.0-only WITH Universal-FOSS-exception-1.0, requireLicenseAcceptance true, depends on MySql.Data 26.10.0. One package covers three frameworks: net8.0 with EF Core 8.0.31, net9.0 with 9.0.20, net10.0 with 10.0.12.
  • Pomelo 9.0.0: licence MIT, depends on MySqlConnector 2.4.0 (also MIT) and on Microsoft.EntityFrameworkCore.Relational [9.0.0, 9.0.999], targeting net8.0.

That last range is the whole story for EF Core 10: Pomelo 9.0.0 accepts EF Core 9.0.x and nothing newer.

requireLicenseAcceptance means NuGet clients prompt you to accept the licence before installing. What the licence means for your project is a question for whoever handles licensing where you work; the identifiers above are the facts to give them.

Check 3: What Happens If You Try Pomelo on EF Core 10​

I added Pomelo 9.0.0 to an EF Core 10 project to see:

Output (dotnet package add Pomelo.EntityFrameworkCore.MySql --version 9.0.0, the errors)
error: NU1608: Warning As Error: Detected package version outside of dependency constraint: Pomelo.EntityFrameworkCore.MySql 9.0.0 requires Microsoft.EntityFrameworkCore.Relational (>= 9.0.0 && <= 9.0.999) but version Microsoft.EntityFrameworkCore.Relational 10.0.14 was resolved.
error: NU1902: Warning As Error: Package 'MySqlConnector' 2.4.0 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-473q-m89c-ghf8

A terminal where adding Pomelo.EntityFrameworkCore.MySql 9.0.0 to an EF Core 10 project fails with NU1608 for the EF Core version range and NU1902 for MySqlConnector 2.4.0.

The project treats warnings as errors, so both stopped the restore. Without that setting they'd be warnings, and the second one matters on its own: the driver version Pomelo 9.0.0 brings has a published advisory. EF Core's providers page settles whether forcing it would work: "EF Core providers typically do not work across major versions." Fixed: "NU1608: Pomelo.EntityFrameworkCore.MySql 9.0.0 requires Microsoft.EntityFrameworkCore.Relational" covers that error.

What It's Like to Use Oracle's Provider​

I built a .NET 10 Web API on MySql.EntityFrameworkCore 10.0.12 against MySQL 9.7. It worked for everything the project needed: migrations, constraints, indexes, transactions. It also has quirks worth knowing before you start, each with its own post:

  • UseCollation is ignored. EF Core's standard method doesn't reach the SQL; the provider's own ForMySQLHasCollation does, for new tables. Fixed: EF Core UseCollation() Doesn't Change the MySQL Column Collation.
  • Save errors have a generic message. Every DbUpdateException says "Could not save changes. Please configure your entity type accordingly."; the real reason is in the inner exception. Fixed: "Could not save changes".
  • An index on a string without a length becomes varchar(255), with a data-loss warning on the migration. How to Set a Maximum String Length in EF Core.
  • The method is UseMySQL, capital SQL, in the MySql.EntityFrameworkCore.Extensions namespace. Code written for Pomelo calls UseMySql, as Microsoft's DbContext configuration page shows for Pomelo.

Common Mistakes​

MistakeWhat happensDo this instead
Following an older tutorial that uses Pomelo on EF Core 10NU1608, and a provider that doesn't support your EF CoreUse a provider version for your EF Core major version
Choosing by download countPopularity reflects the past, not support for the newest releaseCheck the versions on the feed
Trusting a docs table for current versionsIt may lag behind releasesdotnet package search --exact-match
Ignoring the licence until release dayA late surpriseCheck the licence identifier when you choose

FAQ​

Can I switch providers later?​

Yes, but plan for it: the registration call changes, provider-specific configuration changes, and migrations generated by one provider may differ from the other's. Switching early is cheap; switching after many migrations means reviewing them.

Does Oracle's provider work with MariaDB?​

Microsoft's providers page lists it for MySQL only, and Pomelo for "MySQL, MariaDB". I only tested MySQL 9.7.

Conclusion​

For EF Core 10, Oracle's MySql.EntityFrameworkCore 10.0.12 is the MySQL provider with a release: Pomelo's newest, 9.0.0, accepts EF Core 9.0.x only, and failed with NU1608 when I tried it on EF Core 10. Check versions on the package feed rather than in tables, read the licence identifiers, and know Oracle's provider's quirks before you start: UseMySQL, ForMySQLHasCollation, and generic save-error messages.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.