How to use package manager console for creating migrations

Hello everybody,

today I want to describe some basic steps that you can use in order to create and apply migrations to your code.

So, let's start. 

Imagine that in your .Net Core project you made some changes and would like them to be created in a form of C# code migration. How to do this in package manager console? Below are steps that I've applied:

1. add-migration "identity"

2. update-database

Enjoy with results. The first command will create for your C# code that will describe which tables need to be created. Second command will execute that C# code and will create on your db them. 

1 Comment

  • Volodya said

    before 1 and 2 you also need following command to execute in package manager console:

    Enable-Migrations

Add a Comment