Monday 2 September 2024

Migration comments in .net 8 or .net core

1. Install latest Ef core, Design and related packages

2. Update db connection config in Web/Api/Azure funtion APP and set as startup project.

3. Once Code first Entities Created in library project then Open package manger console => Select corresponding library project.

4. Add Migration

PM> Add-Migration migration_name_description

Build started...

Build succeeded.

5. To undo this action, use Remove Migration

PM> Remove-Migration migration_name_description

6. Update Database

PM> update-database –verbose

Build started...

Build succeeded.

It will generate DML & DDL scripts.