In above we can see the tables in the folder. Now let's add some more table and views in the SQL database.
We have added two new item one is table and second one is SQL View. Now let's check the Scaffold command.
Scaffold command syntax for first execution
Scaffold-DbContext "Server=<MS SQL Server Name>;Database=<Database name>;Trusted_Connection=True;TrustServerCertificate=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir data
Above syntax describe the complete command detail which we cna execute. Here we are having following items.
Server: <MS SQL Server Name>;
Database: <Database name>;
Trusted_Connection: True;
TrustServerCertificate:True;
The above command is for running the command first for the application, now to update on second time when we are running, we need to add -force at the end of the Scaffold command. Please check the modified command.
Scaffold command syntax for update Scaffold-DbContext "Server=<MS SQL Server Name>;Database=<Database name>;Trusted_Connection=True;TrustServerCertificate=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir data -force
Now to update the changes in DB we need to run the above (by making change as per your server derail) command from Package manager console.
Now we have done by running the command. Now let's check the solution explorer for changes.