0

By VS 2017, I created an project (database ), everything it's working well。 now I made changes in the CLI commands add new tables(Test) , the question is how to update models to match the database in SQL?

But I don't know how to update the model when the database has been edit. add new table(modelsTest) I using CLI commands

i have reference For detailed information about dotnet ef dbcontext scaffold command https://learn.microsoft.com/en-us/ef/core/cli/dotnet#dotnet-ef-dbcontext-scaffold

test CLI commands :

  1. dotnet ef dbcontext scaffold "Server=xxx.xxx.xxx.xxx\v11.0;Database=xxx;Trusted_Connection=True;User Id=xxxx;Password=xxxxx;Integrated Security=false;" Microsoft.EntityFrameworkCore.SqlServer -o Models -t modelsTest

2.dotnet ef dbcontext scaffold "Server=xxx;Database=xxx;Trusted_Connection=True;User Id=xxxx;Password=xxxxx;Integrated Security=false;" Microsoft.EntityFrameworkCore.SqlServer -o Models -t modelsTest -f

enter image description here

enter image description here

this is a screenshot for my project:

enter image description here

1 Answer 1

0

Please note that there are many differences between Entity Framework 6 and Entity Framework Core (EF Core), and currently no support for edmx in EF Core.

Feature EF6.4 EF Core
Model format: EDMX (XML) Yes No support planned

And the command dotnet ef dbcontext scaffold that you referenced does work with EF Core.

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

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.