0

I've done some ALTER changes in the database then I performed the scaffold command to update my model as follows: Scaffold-DbContext "Server=localhost;Database=<DB_NAME>;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models\Domain -Force -Project <PROJECT_NAME>.

When I check the model in my project I can see the change in code but files are marked as unchanged in the source control so I have to check-out all updated classes myself.

Is there a way to make the scaffold action auto check-out changes in file?

  • @CeceDong-MSFT of course not, the updated files are c# models (classes) which are not excluded. Also, whenever I edit in these files in the IDE (by manually entering or removing text) it is marked as changes in TFS – Omar Allam Feb 15 '20 at 14:23
  • Which version of TFS and VS/Team Explorer do you use? Do you use [local workspace or server workspace](https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/decide-between-using-local-server-workspace?view=azure-devops)? – Cece Dong - MSFT Feb 17 '20 at 08:55

1 Answers1

1

Assuming you are using Server workspace, as with a Server workspace, modifying a file outside of Visual Studio, TFS doesn't seem to detect the change to the file.

It's suggested to use Local Workspace, with Local workspace, when you modify files outside Visual Studio, your workspace should be able to detect the changes automatically.

If you still want to use Server workspace, you would need to check out the file manually or do a compare to find the modified files, check following cases:

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • Thank you very much. Apologies for my late reply I had a problem with my account and I couldn't login to see your comment. – Omar Allam Mar 10 '20 at 18:03