Database Migrations for Person

We use EntityFramework Code-First migrations to migrate database
schema. Since we added Person entity, our DbContext model is
changed. So, we should create a new migration to create the new
table in the database.

Open Package Manager Console, run the Add-Migration
"Added_Persons_Table" command as shown below:

This command will add a migration class named
"Added_Persons_Table" as shown below:

We don't have to know so much about format and rules of this file. But,
it's suggested to have a basic understanding of migrations. In the same
Package Manager Console, we write Update-Database command in order
to apply the new migration to database. After updating, we can see that
PbPersons table is added to database.

But this new table is empty. In ASP.NET Zero, there are some classes to
fill initial data for users and settings:

So, we can add a separated class to fill some people to database as
shown below:

These type of default data is good since we can also use these data in
unit tests. Surely, we should be careful about seed data since this
code will always be executed in each PostInitialize of your
PhoneBookEntityFrameworkCoreModule. This class (InitialPeopleCreator) is
created and called in InitialHostDbBuilder class. This is not so
important, just for a good code organization (see source codes).