Pomelo.entityframeworkcore.mysql: UseMySQL extension method is missing in DbContextOptionsBuilder

Created on 26 Mar 2017  路  6Comments  路  Source: PomeloFoundation/Pomelo.EntityFrameworkCore.MySql

Steps to reproduce

In ConfigureServices when I try following:

 // Add database Context
            services.AddDbContext<ApplicationDbContext>(options =>
            {
                options.UseMySQL(Configuration.Get<AppOptions>().ConnectionStrings.MySqlProvider);
                options.UseOpenIddict();
            });

It doesn't work. Due to DateTimeOffset issue in Sapient I am moving to Pomelo, but UseMySQL extension method is missing. In Sapient
using MySQL.Data.Entity.Extensions;
provided the needed extension.

The issue

UseMySQL extension method is missing.

Exception message:
error CS1061: 'DbContextOptionsBuilder' does not contain a definition for 'UseMySQL' and no extension method 'UseMy
SQL' accepting a first argument of type 'DbContextOptionsBuilder' could be found (are you missing a using directive or an assembly ref
erence?)

Further technical details

MySQL version: 5.7.17
Operating system: macOS
Pomelo.EntityFrameworkCore.MySql version: 1.1.1

Other details about my project setup:

Most helpful comment

It's case-sensitive, UseMySql

Here's an example

All 6 comments

You must import:

using Microsoft.EntityFrameworkCore;

@caleblloyd I tried but still the same error

It's case-sensitive, UseMySql

Here's an example

Thanks, it worked

The link doesn't seem to work anymore and I am having the same issue, can you specify how did you solve it?

Was this page helpful?
0 / 5 - 0 ratings