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.
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?)
MySQL version: 5.7.17
Operating system: macOS
Pomelo.EntityFrameworkCore.MySql version: 1.1.1
Other details about my project setup:
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?
Most helpful comment
It's case-sensitive,
UseMySqlHere's an example