0
votes

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://docs.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

1 Answers

0
votes

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.