I have been trying to perform scaffolding on my existing database SQL Server in VS Code software so as to create DBContext and entity domain models. However in VS Code the only available commands are Add Package and Remove Package, I need to run following command in Nuget Package Manager Console.
Is there any other way to do scaffolding in VS Code.
I am running Dot Net Core 3.1 and EF Core 3.1.3. Database is SQL Server and Writing WEB Api using C#
For this to work you will need to add following package to vscode using Nuget Package Manager: Add Package command from commandpalatte
Microsoft.EntityFrameworkCore.Tools.DotNet (2.0.3 or latest)
Then do
dotnet restore
Then you need to do following command in terminal window of vscode in directory where your csproj file is, -o specifies the output directory where created domain entity models and dbcontext will reside. Suggest you to create a folder beforehand.
dotnet ef dbcontext scaffold "<your existing db connection string>" Microsoft.EntityFrameworkCore.SqlServer -o Models