4

After dropping tables in SQL Server, then re-running scaffolding, the entities of dropped tables do not get deleted.

I've dropped tables manually in SQL Server. Then I ran scaffolding to update the entities in the project. I ran this several times but nothing changed.

My scaffolding command:

Scaffold-DbContext "Data Source=DBHostname;Initial Catalog=DBName;Integrated Security=True;" Microsoft.EntityFramworkCore.SqlServer-OutputDir Entities -context MyDBContext -force

I expected the entities classes to be automatically deleted by scaffolding. The DBContext.cs file did remove all references to the dropped tables/entities. This makes my code build, but the code is not as clean as I am expecting.

Does anyone know how to get scaffolding to remove entity classes to dropped tables?

Thank you.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Phil18013
  • 41
  • 2

0 Answers0