.NET Core 3.1 Entity Framework Core with Visual Studio 2019

Full writeup soon, but in the meantime...

In Package Manager Console, try

Scaffold-DbContext "serverconnectionstring" "Pomelo.EntityFrameworkCore.MySql" -OutputDir Models

If you get an error

Scaffold-DbContext : The term 'Scaffold-DbContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.


Then try:

Install-Package Microsoft.EntityFrameworkCore.Tools

And try again

To update your models from DB you can

Scaffold-DbContext "serverconnectionstring" "Pomelo.EntityFrameworkCore.MySql" -OutputDir Models -force

.NET Core 3.1 Entity Framework with Visual Studio 2019 Last updated 09/03/2020 15:25:40