Creating an identity data store in SQL server

Now we can run migration through the Entity Framework command-line tooling support.

Go to the Command Prompt and navigate to the application's folder where your project file resides.

First, execute this command which creates the migration:

dotnet ef migrations add Initital 

Initial is the name of the migration and once you run this command, it will create a Migrations folders and a file whose name will be ended with Initial.

The naming of migration files is date and time followed by _ and the name of the migration.

Here is a screenshot of the Migrations folder created:

If you open the *_Initial.cs file, you will notice that it contains the Up and Down methods used to create or remove changes to and from a database.

To update the database, we will execute the following command shown in the following snippet that creates the ASP.NET Core Identity tables:

dotnet ef database update

This is an out-of-the-box model provided with ASP.NET Core Identity. With this configuration, we can register users and perform login and logout operations. In a later section, we will see how to restrict access to website resources based on roles, claims, and policies.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.121.101