I am unable to scaffold an API Controller with CRUD using DBContext in Visual Studio 2019 ver 16.xx

Siddharth Seth 1 Reputation point
2021-05-01T18:29:23.777+00:00

When I select the option to add an API Controller. I get an error saying

"There was an error running the selected Code Generator. Package restore failed. Rolling back changes for the project xxx"

I have tried to add the Entity Framework Core Nuget packages, namely EntityFrameworkCore, EntityFrameworkCore.Design and EntityFrameworkCore.SqlServer already. Attempt to do the same operation using CLI also did not work. Any help or assistance to fix or troubleshoot this further would be appreciated.

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Duane Arnold 3,211 Reputation points
    2021-05-03T00:01:34.177+00:00

    @Siddharth Seth

    Reverse Engendering in EF Core Power tools will build the model.

    https://entityframeworkcore.com/articles/carloscds-ef-core-power-tools

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.