Saturday, 15 February 2020

EF Core : Migrations


We have two options to add migrations and update database

1. Using Command line:

  • To add migration "dotnet ef migrations add Initial" where 'Initial' is the name of migration.
  • To Update database " dotnet ef database update" command will update database.

2. Using Package manager console:
  • To add migration " Add-Migration Initial" where Initial is the name of Migration.
  • To Update Database "Update-Databse -migration intial' will update databse.
  • To Revert migration "Update-Database -Migration 0" will revert recently added migration.

No comments:

Post a Comment

How to create and use middleware in asp.net core

Middleware is piece of code that's assembled into an app pipeline to handle requests and responses.  Each middleware component in the re...