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

1
  • 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. Commented Jun 2, 2022 at 2:24

2 Answers 2

1

Use

-Force

Or have a look at EF Core Power Tools.

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.