Thursday, 1 December 2022

Generate SQL script from entity framework using powershell/visual studio


to run the below command , start PowerShell in visual studio. Select the database project.

In PowerShell:

 Script-Migration

this command will generate script from blank database to the latest migration.


Script-Migration migrationname1

this command will generate script from migration named migrationname1 to the latest migration.


Script-Migration migrationname1 migrationnamex

this command will generate script from migration named migrationname1 to migrationnamex



No comments:

Post a Comment

How to use User-secret to protect secrets in dotnet application.

    Using user secrets in a .NET Web API project to securely manage your database password is an excellent practice. It keeps sensitive info...