I am trying to add entity framework to a .Net Standard 2.0 Class Library.
I have tried creating the classes from the DB. I ran the following Command in the nuget package manager console.
Scaffold-DbContext "Server=localhost;Database=FlexDB;uid=root;pwd=ffff;Trusted_Connection=True;" MySql.Data.EntityFrameworkCore -OutputDir EFModels/DB
It unfortunately produces the following error.
Startup project 'FlexData' targets framework '.NETStandard'. There is no runtime associated with this framework, and projects targeting it cannot be executed directly. To use the Entity Framework Core Package Manager Console Tools with this project, add an executable project targeting .NET Framework or .NET Core that references this project, and set it as the startup project; or, update this project to cross-target .NET Framework or .NET Core.
UPDATE-------------
I have followed the instruction from ChrFin but I now get the following error
Could not load type 'Microsoft.EntityFrameworkCore.Infrastructure.DesignTimeProviderServicesAttribute' from assembly 'Microsoft.EntityFrameworkCore, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
Blimey it was easier with an EDMX file and template!!!!!