You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add this statement to your ConfigureServices() method in Startup.cs:
services.AddDbContext<myDbContext>(opts =>
{
var connStr = "your-value-here";
var version = new ServerVersion(new Version(10, 5, 5), ServerType.MariaDb);
opts.UseMySql(connStr, mySqlOptions => mySqlOptions.ServerVersion(version));
});
The issue
The above code compiles and runs well in alpha-1, but in apha-2 it won't compile.
compiler error message:
Startup.cs(49,31): error CS0144: Cannot create an instance of the abstract type or interface 'ServerVersion'
[Server.csproj]
Startup.cs(50,69): error CS1061: 'MySqlDbContextOptionsBuilder' does not contain a definition for 'ServerVersion' and no accessible extension method 'ServerVersion' accepting a first argument of type 'MySqlDbContextOptionsBuilder' could be found (are you missing a using directive or an assembly reference?) [Server.csproj]
Further technical details
MySQL version: 10.5.5-MariaDB-1:10.5.5+maria~bionic mariadb.org binary distribution
Operating system: Ubuntu 20.04.1 LTS
Pomelo.EntityFrameworkCore.MySql version: 5.0.0-alpha.2
Microsoft.AspNetCore.App version: 5.0.100
Other details about my project setup:
The text was updated successfully, but these errors were encountered:
Steps to reproduce
Add this statement to your ConfigureServices() method in Startup.cs:
The issue
The above code compiles and runs well in alpha-1, but in apha-2 it won't compile.
Further technical details
MySQL version: 10.5.5-MariaDB-1:10.5.5+maria~bionic mariadb.org binary distribution
Operating system: Ubuntu 20.04.1 LTS
Pomelo.EntityFrameworkCore.MySql version: 5.0.0-alpha.2
Microsoft.AspNetCore.App version: 5.0.100
Other details about my project setup:
The text was updated successfully, but these errors were encountered: