liveBook · Manning

Schema

As explained in ASP.NET Core in Action, 3e

A database schema is the structural definition of a database's tables, columns, keys, relationships, and related objects.

A database schema defines how data is organized through tables, columns, and relationships. Applications depend on this structure, so changing it requires keeping the stored data and application data model in sync. section 12.3

Use Entity Framework Core to connect an application’s data model to its database schema:

  • Choose a database provider such as SQLite, PostgreSQL, or SQL Server. section 12.2
  • Define the application’s entities and DbContext, then register the DbContext with dependency injection. section 12.2
  • Generate a migration describing changes to the data model and apply it to update the database schema. section 12.2 section 12.3

Adding a new column

When the application’s data model gains a property, create a new EF Core migration and apply it. The migration records the change and updates the existing database without deleting its data. section 12.3

Figure 23.7 The database schema used by ASP.NET Core Identity
CH23_F07_Lock3

Use the Identity schema diagram to inspect the tables required for users and authentication. section 23.3.3

How ASP.NET Core in Action, 3e covers it

How deep it goes
Defines tables, columns, and relationships, then explains versioning through migrations without exploring schema design in great depth.
Examples
Uses SQLite, SQL Server LocalDB, EF Core migrations, and the ASP.NET Core Identity tables as concrete examples.
What it assumes
Assumes an application data model and database provider, while introducing schema organization and versioned changes.
What you can do after
Apply it via EF Core migrations to create a database and update its schema as the application data model changes.
How it connects
Connects database design with data models, Entity Framework Core, migrations, dependency injection, and authentication.

Also explained in

Compare how 44 books explain schema →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.