Scaffold-DbContext update existing model if database changes.


Simple and nice answer -> use Force options as shown below :-

Scaffold-DbContext "Server=localhost;Database=MyDatabase;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir DataModel -FORCE


Anyways if you would like to find out more about that, please jump into the following link.



Comments

Popular posts from this blog

mongosh install properly

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20