0

As the title indicates I Have an SQL server database already made and I excuted the following command to generate DBContext class and the model:

Scaffold-DbContext "connectionstring" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

later on a table has been added through SQL server( Not through a model migration command)

is there a way to generate the related model for it and update the dbContext ?

if i re-excute the command above I would get Build Failed

Angular Dev
  • 19
  • 1
  • 7
  • Hi @Angular Dev, I think you need first check the `Error List` if any error in your project. Build Failed is because your project contains any error. – Rena Jun 02 '22 at 02:24

2 Answers2

1

Use

-Force

Or have a look at EF Core Power Tools.

ErikEJ
  • 40,951
  • 5
  • 75
  • 115
0

you want to update model and context if it already exits then you can use update wizard to update model by clicking on edmx diagram , then right click on empty white space and click update model from db